-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
60 lines (53 loc) · 1.61 KB
/
Gruntfile.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
module.exports = (grunt) ->
grunt.initConfig
path: require "path"
client: "1.1.2"
server: "1.0.0"
# list our available tasks
availabletasks:
tasks:
options:
filter: "include",
tasks: [
"string-replace"
]
descriptions:
"string-replace:server": "Version bump server"
"string-replace:client": "Version bump client"
# used for version bumping
'string-replace':
client:
files:
'src<%= path.sep %>client<%= path.sep %>package.json' : 'src<%= path.sep %>client<%= path.sep %>package.json',
'README.md' : 'README.md',
options:
replacements: [
{
pattern: /("version": "(\d){1,}\.(\d){1,}\.(\d){1,}")/ig,
replacement: '"version": "<%= client %>"'
},
{
pattern: /(- Client: (\d){1,}\.(\d){1,}\.(\d){1,})/ig,
replacement: '- Client: <%= client %>'
},
]
server:
files:
'src<%= path.sep %>server<%= path.sep %>package.json' : 'src<%= path.sep %>server<%= path.sep %>package.json',
'package.json' : 'package.json',
'README.md' : 'README.md',
options:
replacements: [
{
pattern: /("version": "(\d){1,}\.(\d){1,}\.(\d){1,}")/ig,
replacement: '"version": "<%= server %>"'
},
{
pattern: /(- Server: (\d){1,}\.(\d){1,}\.(\d){1,})/ig,
replacement: '- Server: <%= server %>'
},
]
# require our tasks
grunt.loadNpmTasks "grunt-string-replace"
# register our grunt tasks
grunt.registerTask("bump", ["string-replace:client", "string-replace:server"])