mirror of
https://gitlab.com/timvisee/send.git
synced 2024-11-14 07:02:30 +01:00
21 lines
417 B
JavaScript
Executable File
21 lines
417 B
JavaScript
Executable File
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,
|
|
version: pkg.version
|
|
};
|
|
|
|
fs.writeFileSync(filename, JSON.stringify(filedata, null, 2) + '\n');
|