Fix cake task upgrade.
I don't know shit about nodejs/cakefiles, but this should be flawless.
This commit is contained in:
parent
dc8b075317
commit
dd9321ec51
13
Cakefile
13
Cakefile
@ -94,16 +94,13 @@ task 'upgrade', (options) ->
|
|||||||
{version} = options
|
{version} = options
|
||||||
unless version
|
unless version
|
||||||
return
|
return
|
||||||
fs.writeFile LATEST, "postMessage({version:'#{version}'},'*')"
|
regexp = RegExp VERSION, 'g'
|
||||||
for file in [CAKEFILE, INFILE]
|
for file in [CAKEFILE, INFILE, OUTFILE, LATEST]
|
||||||
data = fs.readFileSync file, 'utf8'
|
data = fs.readFileSync file, 'utf8'
|
||||||
fs.writeFile file, data.replace(/^VERSION = .+/m, "VERSION = '#{version}'")
|
fs.writeFileSync file, data.replace(regexp, version)
|
||||||
data = fs.readFileSync CHANGELOG, 'utf8'
|
data = fs.readFileSync CHANGELOG, 'utf8'
|
||||||
fs.writeFile CHANGELOG, data.replace('master', "master\n\n#{version}")
|
fs.writeFileSync CHANGELOG, data.replace('master', "master\n\n#{version}")
|
||||||
exec 'cake build'
|
exec "git commit -am 'Release #{version}.' && git tag -a #{version} -m '#{version}' && git tag -af stable -m '#{version}'"
|
||||||
exec "git commit -am 'Release #{version}.'"
|
|
||||||
exec "git tag -a #{version} -m '#{version}'"
|
|
||||||
exec "git tag -af stable -m '#{version}'"
|
|
||||||
|
|
||||||
task 'build', ->
|
task 'build', ->
|
||||||
exec 'coffee --print script.coffee', (err, stdout, stderr) ->
|
exec 'coffee --print script.coffee', (err, stdout, stderr) ->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user