Move version number to separate file to reduce merge conflicts.
This commit is contained in:
parent
c81997e1ba
commit
4c20d85e13
@ -67,9 +67,15 @@ module.exports = (grunt) ->
|
|||||||
return '' unless grunt.config('pkg').tests_enabled
|
return '' unless grunt.config('pkg').tests_enabled
|
||||||
"throw new Error 'Assertion failed: ' + #{json statement} unless #{statement}"
|
"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.
|
# Project configuration.
|
||||||
grunt.initConfig
|
grunt.initConfig
|
||||||
pkg: grunt.file.readJSON 'package.json'
|
pkg: loadPkg()
|
||||||
|
|
||||||
concat:
|
concat:
|
||||||
options: process: Object.create(null, data:
|
options: process: Object.create(null, data:
|
||||||
@ -258,6 +264,7 @@ module.exports = (grunt) ->
|
|||||||
files: [
|
files: [
|
||||||
'Gruntfile.coffee'
|
'Gruntfile.coffee'
|
||||||
'package.json'
|
'package.json'
|
||||||
|
'version.json'
|
||||||
'src/**/*'
|
'src/**/*'
|
||||||
]
|
]
|
||||||
tasks: 'build'
|
tasks: 'build'
|
||||||
@ -468,13 +475,13 @@ module.exports = (grunt) ->
|
|||||||
grunt.task.run 'shell:captchas'
|
grunt.task.run 'shell:captchas'
|
||||||
|
|
||||||
grunt.registerTask 'setversion', 'Set the version number', (version) ->
|
grunt.registerTask 'setversion', 'Set the version number', (version) ->
|
||||||
pkg = grunt.file.readJSON 'package.json'
|
data = grunt.file.readJSON 'version.json'
|
||||||
oldversion = pkg.meta.version
|
oldversion = data.version
|
||||||
pkg.meta.version = version
|
data.version = version
|
||||||
pkg.meta.date = new Date()
|
data.date = new Date()
|
||||||
grunt.config 'pkg', pkg
|
grunt.file.write 'version.json', JSON.stringify(data, null, 2) + '\n'
|
||||||
grunt.file.write 'package.json', JSON.stringify(pkg, null, 2) + '\n'
|
|
||||||
grunt.log.ok "Version updated from v#{oldversion} to v#{version}."
|
grunt.log.ok "Version updated from v#{oldversion} to v#{version}."
|
||||||
|
grunt.config 'pkg', loadPkg()
|
||||||
|
|
||||||
grunt.registerTask 'updcl', 'Update the changelog', ->
|
grunt.registerTask 'updcl', 'Update the changelog', ->
|
||||||
{meta, name} = grunt.config('pkg')
|
{meta, name} = grunt.config('pkg')
|
||||||
|
|||||||
@ -4,8 +4,6 @@
|
|||||||
"meta": {
|
"meta": {
|
||||||
"name": "4chan X",
|
"name": "4chan X",
|
||||||
"fork": "ccd0",
|
"fork": "ccd0",
|
||||||
"version": "1.11.14.12",
|
|
||||||
"date": "2015-11-01T00:02:41.314Z",
|
|
||||||
"page": "https://www.4chan-x.net/",
|
"page": "https://www.4chan-x.net/",
|
||||||
"downloads": "https://www.4chan-x.net/builds/",
|
"downloads": "https://www.4chan-x.net/builds/",
|
||||||
"oldVersions": "https://raw.githubusercontent.com/ccd0/4chan-x/",
|
"oldVersions": "https://raw.githubusercontent.com/ccd0/4chan-x/",
|
||||||
|
|||||||
4
version.json
Normal file
4
version.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"version": "1.11.14.12",
|
||||||
|
"date": "2015-11-01T00:02:41.314Z"
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user