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

Commit

Permalink
Fix unknown version
Browse files Browse the repository at this point in the history
  • Loading branch information
willdurand committed Apr 20, 2016
1 parent 82b4888 commit 1f7c1a7
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,19 @@ const PATHS = {
app: path.join(__dirname, 'app'),
build: path.join(__dirname, 'build')
};
const VERSION = process.env.SOURCE_VERSION || process.env.SHA || childProcess.execSync('git rev-parse HEAD').toString();

const VERSION = () => {
var v;

try {
v = process.env.SOURCE_VERSION || process.env.SHA || childProcess.execSync('git rev-parse HEAD').toString();
} catch (e) {
// occurs with Heroku deploy button for instance
v = 'unknown';
}

return v;
}();

// Used to configure Babel (see: `.babelrc` file)
process.env.BABEL_ENV = TARGET;
Expand Down

0 comments on commit 1f7c1a7

Please sign in to comment.