mirror of
https://gitlab.com/timvisee/send.git
synced 2025-12-06 14:10:53 +03:00
Move __version__ to a script
This commit is contained in:
20
scripts/version.js
Executable file
20
scripts/version.js
Executable file
@@ -0,0 +1,20 @@
|
||||
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');
|
||||
Reference in New Issue
Block a user