diff --git a/githooks/update b/githooks/update index 5470f00d8..638253928 100755 --- a/githooks/update +++ b/githooks/update @@ -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'}); diff --git a/js/client.js b/js/client.js index 9203887aa..a5f7e0d4e 100644 --- a/js/client.js +++ b/js/client.js @@ -1,7 +1,5 @@ (function ($) { - Config.version = '0.10.2'; - Config.sockjsprefix = '/showdown'; Config.root = '/';