@@ -9,27 +9,25 @@ Release.define({
99
1010 Release . chdir ( Release . dir . base ) ;
1111 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." ) ;
1314 Release . chdir ( Release . dir . repo ) ;
1415
1516 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." ) ;
1718 console . log ( ) ;
1819
1920 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." ) ;
2322 console . log ( ) ;
2423
2524 projectRelease = require ( Release . dir . repo + "/build/release" ) ;
2625
2726 if ( projectRelease . dependencies ) {
2827 console . log ( "Installing release dependencies..." ) ;
2928 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." ) ;
3331 console . log ( ) ;
3432 }
3533
@@ -67,11 +65,11 @@ Release.define({
6765 . pop ( ) ;
6866
6967 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 ] ;
7573
7674 if ( lastListedAuthor !== lastActualAuthor ) {
7775 console . log ( "Last listed author is " + lastListedAuthor . red + "." ) ;
@@ -145,8 +143,8 @@ Release.define({
145143 Release . abort (
146144 "This script is not smart enough to handle major release (eg. 2.0.0)." ) ;
147145 } 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)' " +
150148 "refs/tags/" + [ major , minor - 1 ] . join ( "." ) + "*"
151149 ) . trim ( ) ;
152150 } else {
@@ -166,7 +164,7 @@ Release.define({
166164
167165 Release . chdir ( Release . dir . repo ) ;
168166 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." ) ;
170168 console . log ( ) ;
171169
172170 Release . _setVersion ( Release . newVersion ) ;
@@ -199,14 +197,15 @@ Release.define({
199197
200198 Release . chdir ( Release . dir . repo ) ;
201199 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 + "'" ,
204202 "Error committing release changes." ) ;
205203 console . log ( ) ;
206204
207205 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'" ,
210209 "Error getting tag timestamp." ) . trim ( ) ;
211210 } ,
212211
@@ -217,28 +216,28 @@ Release.define({
217216 _pushRelease : function ( ) {
218217 Release . chdir ( Release . dir . repo ) ;
219218 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." ) ;
221220 } ,
222221
223222 _updateBranchVersion : function ( ) {
224223 Release . chdir ( Release . dir . repo ) ;
225224 console . log ( "Checking out " + Release . branch . cyan + " branch..." ) ;
226- Release . git ( "checkout " + Release . branch ,
225+ Release . exec ( "git checkout " + Release . branch ,
227226 "Error checking out " + Release . branch + " branch." ) ;
228227
229228 // Update all JSON versions
230229 Release . _setVersion ( Release . nextVersion ) ;
231230
232231 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 +
234233 " version to " + Release . nextVersion + ".'" ,
235234 "Error committing package.json." ) ;
236235 } ,
237236
238237 _pushBranch : function ( ) {
239238 Release . chdir ( Release . dir . repo ) ;
240239 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." ) ;
242241 }
243242} ) ;
244243
0 commit comments