2017-06-24 01:53:17 +02:00
|
|
|
const fs = require('fs');
|
|
|
|
const path = require('path');
|
|
|
|
const pkg = require('../package.json');
|
|
|
|
|
|
|
|
let commit;
|
|
|
|
|
|
|
|
try {
|
|
|
|
commit = require('git-rev-sync').short();
|
|
|
|
} catch (err) {
|
|
|
|
// Whatever...
|
|
|
|
}
|
|
|
|
|
|
|
|
const filename = path.join(__dirname, '..', 'public', 'version.json');
|
|
|
|
const filedata = {
|
|
|
|
commit,
|
|
|
|
source: pkg.homepage,
|
2017-07-25 03:25:28 +02:00
|
|
|
version: process.env.CIRCLE_TAG || pkg.version
|
2017-06-24 01:53:17 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
fs.writeFileSync(filename, JSON.stringify(filedata, null, 2) + '\n');
|