Check if working directory is a git repo itself before getting commit hash
This commit is contained in:
parent
3cf4e2105e
commit
2006902b8a
@ -62,6 +62,11 @@ function getGitCommit() {
|
|||||||
return _gitCommit;
|
return _gitCommit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!fs.existsSync(path.resolve(__dirname, "..", ".git", "HEAD"))) {
|
||||||
|
_gitCommit = null;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
_gitCommit = require("child_process")
|
_gitCommit = require("child_process")
|
||||||
.execSync(
|
.execSync(
|
||||||
|
Loading…
Reference in New Issue
Block a user