Catch if git doesn't exist

This commit is contained in:
Travis Shivers 2020-06-10 21:42:38 -05:00
parent dd12c405e6
commit 7fc31241ed
1 changed files with 8 additions and 2 deletions

View File

@ -8,8 +8,14 @@ const settings = readSettings();
process.env.VUE_APP_CONFIGURATION = JSON.stringify(settings);
process.env.VUE_APP_VERSION = require('./package.json').version;
process.env.VUE_APP_GIT_HASH = git.short();
process.env.VUE_APP_GIT_DATE = git.date().toISOString();
try {
process.env.VUE_APP_GIT_HASH = git.short();
process.env.VUE_APP_GIT_DATE = git.date().toISOString();
} catch (e) {
// Sometimes on CI stuff they build with .git being present
process.env.VUE_APP_GIT_DATE = new Date().toISOString();
}
module.exports = {
publicPath: settings.webroot,