@@ -9,27 +9,25 @@ Release.define({
9
9
10
10
Release . chdir ( Release . dir . base ) ;
11
11
console . log ( "Cloning " + Release . remote . cyan + "..." ) ;
12
- Release . git ( "clone " + Release . remote + " " + Release . dir . repo , "Error cloning repo." ) ;
12
+ Release . exec ( "git clone " + Release . remote + " " + Release . dir . repo ,
13
+ "Error cloning repo." ) ;
13
14
Release . chdir ( Release . dir . repo ) ;
14
15
15
16
console . log ( "Checking out " + Release . branch . cyan + " branch..." ) ;
16
- Release . git ( "checkout " + Release . branch , "Error checking out branch." ) ;
17
+ Release . exec ( "git checkout " + Release . branch , "Error checking out branch." ) ;
17
18
console . log ( ) ;
18
19
19
20
console . log ( "Installing dependencies..." ) ;
20
- if ( Release . exec ( "npm install" ) . code !== 0 ) {
21
- Release . abort ( "Error installing dependencies." ) ;
22
- }
21
+ Release . exec ( "npm install" , "Error installing dependencies." ) ;
23
22
console . log ( ) ;
24
23
25
24
projectRelease = require ( Release . dir . repo + "/build/release" ) ;
26
25
27
26
if ( projectRelease . dependencies ) {
28
27
console . log ( "Installing release dependencies..." ) ;
29
28
releaseDependencies = projectRelease . dependencies . join ( " " ) ;
30
- if ( Release . exec ( "npm install " + releaseDependencies ) . code !== 0 ) {
31
- Release . abort ( "Error installing release dependencies." ) ;
32
- }
29
+ Release . exec ( "npm install " + releaseDependencies ,
30
+ "Error installing release dependencies." ) ;
33
31
console . log ( ) ;
34
32
}
35
33
@@ -67,11 +65,11 @@ Release.define({
67
65
. pop ( ) ;
68
66
69
67
Release . chdir ( Release . dir . repo ) ;
70
- result = Release . exec ( "grunt authors" , { silent : true } ) ;
71
- if ( result . code !== 0 ) {
72
- Release . abort ( "Error getting list of authors." ) ;
73
- }
74
- lastActualAuthor = result . output . split ( / \r ? \n / ) . splice ( - 4 , 1 ) [ 0 ] ;
68
+ result = Release . exec ( {
69
+ command : "grunt authors" ,
70
+ silent : true
71
+ } , "Error getting list of authors." ) ;
72
+ lastActualAuthor = result . split ( / \r ? \n / ) . splice ( - 4 , 1 ) [ 0 ] ;
75
73
76
74
if ( lastListedAuthor !== lastActualAuthor ) {
77
75
console . log ( "Last listed author is " + lastListedAuthor . red + "." ) ;
@@ -145,8 +143,8 @@ Release.define({
145
143
Release . abort (
146
144
"This script is not smart enough to handle major release (eg. 2.0.0)." ) ;
147
145
} else if ( patch === 0 ) {
148
- Release . prevVersion = Release . git (
149
- "for-each-ref --count=1 --sort=-authordate --format='%(refname:short)' " +
146
+ Release . prevVersion = Release . exec (
147
+ "git for-each-ref --count=1 --sort=-authordate --format='%(refname:short)' " +
150
148
"refs/tags/" + [ major , minor - 1 ] . join ( "." ) + "*"
151
149
) . trim ( ) ;
152
150
} else {
@@ -166,7 +164,7 @@ Release.define({
166
164
167
165
Release . chdir ( Release . dir . repo ) ;
168
166
console . log ( "Creating " + "release" . cyan + " branch..." ) ;
169
- Release . git ( "checkout -b release" , "Error creating release branch." ) ;
167
+ Release . exec ( "git checkout -b release" , "Error creating release branch." ) ;
170
168
console . log ( ) ;
171
169
172
170
Release . _setVersion ( Release . newVersion ) ;
@@ -199,14 +197,15 @@ Release.define({
199
197
200
198
Release . chdir ( Release . dir . repo ) ;
201
199
console . log ( "Committing release artifacts..." ) ;
202
- Release . git ( "add -f " + paths . join ( " " ) , "Error adding release artifacts to git." ) ;
203
- Release . git ( "commit -m '" + Release . newVersion + "'" ,
200
+ Release . exec ( "git add -f " + paths . join ( " " ) , "Error adding release artifacts to git." ) ;
201
+ Release . exec ( "git commit -m '" + Release . newVersion + "'" ,
204
202
"Error committing release changes." ) ;
205
203
console . log ( ) ;
206
204
207
205
console . log ( "Tagging release..." ) ;
208
- Release . git ( "tag " + Release . newVersion , "Error tagging " + Release . newVersion + "." ) ;
209
- Release . tagTime = Release . git ( "log -1 --format='%ad'" ,
206
+ Release . exec ( "git tag " + Release . newVersion ,
207
+ "Error tagging " + Release . newVersion + "." ) ;
208
+ Release . tagTime = Release . exec ( "git log -1 --format='%ad'" ,
210
209
"Error getting tag timestamp." ) . trim ( ) ;
211
210
} ,
212
211
@@ -217,28 +216,28 @@ Release.define({
217
216
_pushRelease : function ( ) {
218
217
Release . chdir ( Release . dir . repo ) ;
219
218
console . log ( "Pushing release to git repo..." ) ;
220
- Release . git ( "push --tags" , "Error pushing tags to git repo." ) ;
219
+ Release . exec ( "git push --tags" , "Error pushing tags to git repo." ) ;
221
220
} ,
222
221
223
222
_updateBranchVersion : function ( ) {
224
223
Release . chdir ( Release . dir . repo ) ;
225
224
console . log ( "Checking out " + Release . branch . cyan + " branch..." ) ;
226
- Release . git ( "checkout " + Release . branch ,
225
+ Release . exec ( "git checkout " + Release . branch ,
227
226
"Error checking out " + Release . branch + " branch." ) ;
228
227
229
228
// Update all JSON versions
230
229
Release . _setVersion ( Release . nextVersion ) ;
231
230
232
231
console . log ( "Committing version update..." ) ;
233
- Release . git ( "commit -am 'Build: Updating the " + Release . branch +
232
+ Release . exec ( "git commit -am 'Build: Updating the " + Release . branch +
234
233
" version to " + Release . nextVersion + ".'" ,
235
234
"Error committing package.json." ) ;
236
235
} ,
237
236
238
237
_pushBranch : function ( ) {
239
238
Release . chdir ( Release . dir . repo ) ;
240
239
console . log ( "Pushing " + Release . branch . cyan + " to GitHub..." ) ;
241
- Release . git ( "push" , "Error pushing to GitHub." ) ;
240
+ Release . exec ( "git push" , "Error pushing to GitHub." ) ;
242
241
}
243
242
} ) ;
244
243
0 commit comments