@@ -89,16 +89,16 @@ function publishDocs(cb) {
8989 currentDir = process . cwd ( ) ;
9090 shell . rm ( '-rf' , ghPagesDir ) ;
9191 shell . mkdir ( ghPagesDir ) ;
92- execHandlingErrors ( 'git clone -b gh-pages https://github.com/bhovhannes/attask-api.git "' + ghPagesDir + '"' ) ;
92+ shellExec ( 'git clone -b gh-pages https://github.com/bhovhannes/attask-api.git "' + ghPagesDir + '"' ) ;
9393 shell . rm ( '-rf' , path . join ( ghPagesDir , '*' ) ) ;
9494
9595 var stream = generateDocs ( ghPagesDir ) ;
9696 stream . on ( 'finish' , function ( ) {
9797 shell . cd ( ghPagesDir ) ;
98- execHandlingErrors ( 'git add -A .' ) ;
99- execHandlingErrors ( 'git commit -m "Autogenerated new docs at ' + dateformat ( new Date ( ) ) + '"' ) ;
100- execHandlingErrors ( 'git fetch origin && git rebase origin/gh-pages' ) ;
101- execHandlingErrors ( 'git push origin gh-pages' ) ;
98+ shellExec ( 'git add -A .' ) ;
99+ shellExec ( 'git commit -m "Autogenerated new docs at ' + dateformat ( new Date ( ) ) + '"' ) ;
100+ shellExec ( 'git fetch origin && git rebase origin/gh-pages' ) ;
101+ shellExec ( 'git push origin gh-pages' ) ;
102102
103103 shell . cd ( currentDir ) ;
104104 shell . rm ( '-rf' , ghPagesDir ) ;
@@ -126,7 +126,7 @@ function getVersionTags() {
126126 var shell = require ( 'shelljs' ) ,
127127 semver = require ( 'semver' ) ;
128128
129- var tags = splitCommandResultToLines ( execHandlingErrors ( "git tag" , { silent : true } ) ) ;
129+ var tags = splitCommandResultToLines ( shellExec ( "git tag" , { silent : true } ) ) ;
130130
131131 return tags . reduce ( function ( list , tag ) {
132132 if ( semver . valid ( tag ) ) {
@@ -164,7 +164,7 @@ function generateChangelog() {
164164 header . to ( "CHANGELOG.tmp" ) ;
165165
166166 // get log statements
167- var logs = execHandlingErrors ( "git log --pretty=format:\"* %s (%an)\" " + rangeTags . join ( ".." ) , { silent : true } ) . split ( / \n / g) ;
167+ var logs = shellExec ( "git log --pretty=format:\"* %s (%an)\" " + rangeTags . join ( ".." ) , { silent : true } ) . split ( / \n / g) ;
168168 logs = logs . filter ( function ( line ) {
169169 return line . indexOf ( "Merge pull request" ) === - 1 && line . indexOf ( "Merge branch" ) === - 1 ;
170170 } ) ;
@@ -191,20 +191,20 @@ function release(type, cb) {
191191 testsStream . on ( 'error' , cb ) ;
192192 testsStream . on ( 'end' , function ( ) {
193193 try {
194- var newVersion = execHandlingErrors ( "npm version " + type , { silent : true } ) . trim ( ) ;
194+ var newVersion = shellExec ( "npm version " + type , { silent : true } ) . trim ( ) ;
195195 generateChangelog ( ) ;
196196
197197 // add changelog to commit
198- execHandlingErrors ( "git add CHANGELOG.md" ) ;
199- execHandlingErrors ( "git commit --amend --no-edit" ) ;
198+ shellExec ( "git add CHANGELOG.md" ) ;
199+ shellExec ( "git commit --amend --no-edit" ) ;
200200
201201 // replace existing tag
202- execHandlingErrors ( "git tag -f " + newVersion ) ;
202+ shellExec ( "git tag -f " + newVersion ) ;
203203
204204 // push all the things
205- execHandlingErrors ( "git push origin master --tags" ) ;
205+ shellExec ( "git push origin master --tags" ) ;
206206
207- execHandlingErrors ( "npm publish" ) ;
207+ shellExec ( "npm publish" ) ;
208208 publishDocs ( cb ) ;
209209 }
210210 catch ( e ) {
@@ -213,9 +213,9 @@ function release(type, cb) {
213213 } ) ;
214214}
215215
216- function execHandlingErrors ( cmd ) {
216+ function shellExec ( ) {
217217 var shell = require ( 'shelljs' ) ;
218- var execResult = shell . exec ( cmd ) ;
218+ var execResult = shell . exec . apply ( shell , arguments ) ;
219219 if ( execResult . code ) {
220220 throw new Error ( execResult . output ) ;
221221 }
0 commit comments