Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

Commit

Permalink
Fix npm build with missing .git
Browse files Browse the repository at this point in the history
  • Loading branch information
cjford committed Dec 9, 2019
1 parent d2746db commit d40ddc3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion build/version_plugin.js
Original file line number Diff line number Diff line change
@@ -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,
Expand Down

0 comments on commit d40ddc3

Please sign in to comment.