Move version number to separate file to reduce merge conflicts.

This commit is contained in:
ccd0 2015-11-01 02:00:31 -08:00
parent c81997e1ba
commit 4c20d85e13
3 changed files with 18 additions and 9 deletions

View File

@ -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')

View File

@ -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/",

4
version.json Normal file
View File

@ -0,0 +1,4 @@
{
"version": "1.11.14.12",
"date": "2015-11-01T00:02:41.314Z"
}