Cake task: ugrade. Close #256
This commit is contained in:
parent
5ff3878360
commit
bf18a4b06b
24
Cakefile
24
Cakefile
@ -81,8 +81,28 @@ HEADER = """
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
INFILE = 'script.coffee'
|
CAKEFILE = 'Cakefile'
|
||||||
OUTFILE = '4chan_x.user.js'
|
INFILE = 'script.coffee'
|
||||||
|
OUTFILE = '4chan_x.user.js'
|
||||||
|
CHANGELOG = 'changelog'
|
||||||
|
LATEST = 'latest.js'
|
||||||
|
|
||||||
|
option '-v', '--version [version]', 'Upgrade version.'
|
||||||
|
|
||||||
|
task 'upgrade', (options) ->
|
||||||
|
{version} = options
|
||||||
|
unless version
|
||||||
|
return
|
||||||
|
fs.writeFile LATEST, "postMessage({version:'#{version}'},'*')"
|
||||||
|
for file in [CAKEFILE, INFILE]
|
||||||
|
data = fs.readFileSync file, 'utf8'
|
||||||
|
fs.writeFile file, data.replace(/^VERSION = .+/m, "VERSION = '#{version}'")
|
||||||
|
data = fs.readFileSync CHANGELOG, 'utf8'
|
||||||
|
fs.writeFile CHANGELOG, data.replace('master', "master\n\n#{version}")
|
||||||
|
exec 'cake build'
|
||||||
|
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) ->
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
postMessage({version:'2.28.0'},'*');
|
postMessage({version:'2.28.0'},'*')
|
||||||
@ -7,3 +7,4 @@
|
|||||||
- Clone 4chan X.
|
- Clone 4chan X.
|
||||||
- `cd` into it and build with `cake build`.
|
- `cd` into it and build with `cake build`.
|
||||||
- For development (continuous builds), run `cake dev &`. Kill the process with `killall node`.
|
- For development (continuous builds), run `cake dev &`. Kill the process with `killall node`.
|
||||||
|
- Upgrade version with `cake -v VERSION upgrade`
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user