Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita7f9c6a

Browse files
committed
fix the empty dir command
1 parente8674d9 commita7f9c6a

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-
constgit=simpleGit(__dirname);
50+
constgit=simpleGit(process.cwd());
5151
constisRepo=awaitgit.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)

[8]ページ先頭

©2009-2025 Movatter.jp