Skip to content

Commit 0db29b7

Browse files
fix(publish_yalc): Check if directory/.git exists, not just directory.
1 parent 3710c6a commit 0db29b7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

publish_yalc_package.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env node
22
const fs = require('fs');
3+
const path = require('path');
34
const util = require('./util');
45

56
const ORIG_DIR = process.cwd();
@@ -9,7 +10,7 @@ function publishYalcPackage(installDir, githubUrl) {
910
throw new Error('Usage: publish_yalc_package [INSTALL_DIR] [GITHUB_URL]');
1011
}
1112

12-
if (!fs.existsSync(installDir)) {
13+
if (!fs.existsSync(path.join(installDir, '.git'))) {
1314
util._exec('git clone '+ githubUrl + ' ' + installDir);
1415
}
1516

0 commit comments

Comments
 (0)