Revert gruntfile changes
This commit is contained in:
parent
35b2015928
commit
a4b0468698
@ -1,6 +1,5 @@
|
|||||||
module.exports = (grunt) ->
|
module.exports = (grunt) ->
|
||||||
|
|
||||||
pkg = grunt.file.readJSON 'package.json'
|
|
||||||
concatOptions =
|
concatOptions =
|
||||||
process: Object.create(null, data:
|
process: Object.create(null, data:
|
||||||
get: -> grunt.config 'pkg'
|
get: -> grunt.config 'pkg'
|
||||||
@ -13,7 +12,7 @@ module.exports = (grunt) ->
|
|||||||
|
|
||||||
# Project configuration.
|
# Project configuration.
|
||||||
grunt.initConfig
|
grunt.initConfig
|
||||||
pkg: pkg
|
pkg: grunt.file.readJSON 'package.json'
|
||||||
concat:
|
concat:
|
||||||
coffee:
|
coffee:
|
||||||
options: concatOptions
|
options: concatOptions
|
||||||
@ -169,39 +168,34 @@ module.exports = (grunt) ->
|
|||||||
|
|
||||||
grunt.registerTask 'release', [
|
grunt.registerTask 'release', [
|
||||||
'build'
|
'build'
|
||||||
'compress:crx'
|
|
||||||
'shell:commit'
|
'shell:commit'
|
||||||
'shell:push'
|
'shell:push'
|
||||||
|
'build-crx'
|
||||||
|
'compress:crx'
|
||||||
]
|
]
|
||||||
grunt.registerTask 'patch', [
|
grunt.registerTask 'patch', [
|
||||||
'bump'
|
'bump'
|
||||||
'reloadPkg'
|
|
||||||
'updcl:3'
|
'updcl:3'
|
||||||
|
'release'
|
||||||
]
|
]
|
||||||
|
|
||||||
grunt.registerTask 'minor', [
|
grunt.registerTask 'minor', [
|
||||||
'bump:minor'
|
'bump:minor'
|
||||||
'reloadPkg'
|
|
||||||
'updcl:2'
|
'updcl:2'
|
||||||
|
'release'
|
||||||
]
|
]
|
||||||
|
|
||||||
grunt.registerTask 'major', [
|
grunt.registerTask 'major', [
|
||||||
'bump:major'
|
'bump:major'
|
||||||
'reloadPkg'
|
|
||||||
'updcl:1'
|
'updcl:1'
|
||||||
|
'release'
|
||||||
]
|
]
|
||||||
|
|
||||||
grunt.registerTask 'reloadPkg', 'Reload the package', ->
|
grunt.registerTask 'updcl', 'Update the changelog', (headerLevel) ->
|
||||||
# Update the `pkg` object with the new version.
|
headerPrefix = new Array(+headerLevel + 1).join '#'
|
||||||
pkg = grunt.file.readJSON('package.json')
|
{version} = grunt.config 'pkg'
|
||||||
grunt.config.data.pkg = concatOptions.process.data = pkg
|
today = grunt.template.today 'yyyy-mm-dd'
|
||||||
grunt.log.ok('pkg reloaded.')
|
changelog = grunt.file.read 'CHANGELOG.md'
|
||||||
|
|
||||||
grunt.registerTask 'updcl', 'Update the changelog', (i) ->
|
|
||||||
# i is the number of #s for markdown.
|
|
||||||
version = []
|
|
||||||
version.length = +i + 1
|
|
||||||
version = version.join('#') + ' v' + pkg.version + '\n*' + grunt.template.today('yyyy-mm-dd') + '*\n'
|
|
||||||
grunt.file.write 'CHANGELOG.md', version + '\n' + grunt.file.read('CHANGELOG.md')
|
|
||||||
grunt.log.ok 'Changelog updated for v' + pkg.version + '.'
|
|
||||||
|
|
||||||
|
grunt.file.write 'CHANGELOG.md', "#{headerPrefix} #{version} - *#{today}*\n\n#{changelog}"
|
||||||
|
grunt.log.ok "Changelog updated for v#{version}."
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user