mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-10-02 07:42:12 -05:00
Autogenerate version number
The version number is now generated from package.json instead of needing to be manually updated in multiple places.
This commit is contained in:
@@ -23,6 +23,17 @@ const rootDir = path.resolve(thisDir, '..');
|
||||
const Tools = require('../data/Pokemon-Showdown/tools').includeData();
|
||||
const toId = Tools.getId;
|
||||
|
||||
// update version
|
||||
process.stdout.write("Updating version... ");
|
||||
|
||||
let version = require('../package.json').version;
|
||||
|
||||
let configBuf = fs.readFileSync(path.resolve(rootDir, 'config/config.js'), {encoding: 'utf8'});
|
||||
configBuf = configBuf.replace(/\/\* version \*\/[^;\n]*;/, `/* version */ Config.version = ${JSON.stringify(version)};`);
|
||||
|
||||
fs.writeFileSync(path.resolve(rootDir, 'config/config.js'), configBuf);
|
||||
console.log("DONE");
|
||||
|
||||
function updateIndex() {
|
||||
let indexContents = fs.readFileSync(path.resolve(rootDir, 'index.template.html'), {encoding: 'utf8'});
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
(function ($) {
|
||||
|
||||
Config.version = '0.10.2';
|
||||
|
||||
Config.sockjsprefix = '/showdown';
|
||||
Config.root = '/';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user