Skip to content

Commit a7f9c6a

Browse files
committed
fix the empty dir command
1 parent e8674d9 commit a7f9c6a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/cli.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ async function promptForMissingOptions(options) {
4747
if (!options.git && !options.dir) {
4848

4949
// check if the current dir is a valid repo
50-
const git = simpleGit(__dirname);
50+
const git = simpleGit(process.cwd());
5151
const isRepo = await git.checkIsRepo();
5252

5353
if (!isRepo) {
5454

5555
questions.push({
5656
type: 'list',
5757
name: 'source',
58-
message: `The current directory (${__dirname}) is not a valid git repo. Would you like to provide a...`,
58+
message: `The current directory (${process.cwd()}) is not a valid git repo. Would you like to provide a...`,
5959
choices: [localGit, remoteGit],
6060
default: localGit,
6161
});
@@ -114,7 +114,7 @@ async function promptForMissingOptions(options) {
114114
isLocal = answers.source === localGit;
115115
}
116116
else {
117-
repo = options.dir || options.git || __dirname;
117+
repo = options.dir || options.git || process.cwd();
118118
isLocal = options.git ? false : true;
119119
}
120120

0 commit comments

Comments
 (0)