diff --git a/Gruntfile.coffee b/Gruntfile.coffee index df205712e..623ffb992 100755 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -67,9 +67,15 @@ module.exports = (grunt) -> return '' unless grunt.config('pkg').tests_enabled "throw new Error 'Assertion failed: ' + #{json statement} unless #{statement}" + loadPkg = -> + pkg = grunt.file.readJSON 'package.json' + version = grunt.file.readJSON 'version.json' + pkg.meta[key] = val for key, val of version + pkg + # Project configuration. grunt.initConfig - pkg: grunt.file.readJSON 'package.json' + pkg: loadPkg() concat: options: process: Object.create(null, data: @@ -258,6 +264,7 @@ module.exports = (grunt) -> files: [ 'Gruntfile.coffee' 'package.json' + 'version.json' 'src/**/*' ] tasks: 'build' @@ -468,13 +475,13 @@ module.exports = (grunt) -> grunt.task.run 'shell:captchas' grunt.registerTask 'setversion', 'Set the version number', (version) -> - pkg = grunt.file.readJSON 'package.json' - oldversion = pkg.meta.version - pkg.meta.version = version - pkg.meta.date = new Date() - grunt.config 'pkg', pkg - grunt.file.write 'package.json', JSON.stringify(pkg, null, 2) + '\n' + data = grunt.file.readJSON 'version.json' + oldversion = data.version + data.version = version + data.date = new Date() + grunt.file.write 'version.json', JSON.stringify(data, null, 2) + '\n' grunt.log.ok "Version updated from v#{oldversion} to v#{version}." + grunt.config 'pkg', loadPkg() grunt.registerTask 'updcl', 'Update the changelog', -> {meta, name} = grunt.config('pkg') diff --git a/package.json b/package.json index 53f908e55..d8382e9e1 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,6 @@ "meta": { "name": "4chan X", "fork": "ccd0", - "version": "1.11.14.12", - "date": "2015-11-01T00:02:41.314Z", "page": "https://www.4chan-x.net/", "downloads": "https://www.4chan-x.net/builds/", "oldVersions": "https://raw.githubusercontent.com/ccd0/4chan-x/", diff --git a/version.json b/version.json new file mode 100644 index 000000000..0570761d6 --- /dev/null +++ b/version.json @@ -0,0 +1,4 @@ +{ + "version": "1.11.14.12", + "date": "2015-11-01T00:02:41.314Z" +}