Check if working directory is a git repo itself before getting commit hash

This commit is contained in:
Jérémie Astori 2018-04-16 16:08:30 +02:00
parent 3cf4e2105e
commit 2006902b8a
No known key found for this signature in database
GPG key ID: B9A4F245CD67BDE8

View file

@ -62,6 +62,11 @@ function getGitCommit() {
return _gitCommit;
}
if (!fs.existsSync(path.resolve(__dirname, "..", ".git", "HEAD"))) {
_gitCommit = null;
return null;
}
try {
_gitCommit = require("child_process")
.execSync(