1
0
mirror of https://gitlab.com/timvisee/send.git synced 2024-11-09 20:52:39 +01:00

Fix npm build with missing .git

This commit is contained in:
Connor Ford 2019-12-06 14:53:09 -07:00 committed by Connor Ford
parent d2746db969
commit d40ddc3d3b

View File

@ -1,6 +1,14 @@
const commit = require('git-rev-sync').short();
const gitRevSync = require('git-rev-sync');
const pkg = require('../package.json');
let commit = 'unknown';
try {
commit = gitRevSync.short();
} catch (e) {
console.warn('Error fetching current git commit: ' + e);
}
const version = JSON.stringify({
commit,
source: pkg.homepage,