@@ -138,31 +138,32 @@ getBranchName().then(
138138
139139// 6 - Zip release files
140140. then ( function ( ) {
141- var path = 'gh-pages/' + pkg . dir + '/' ;
142- var zipFile = 'hasplayer.js-v' + pkg . version + '.zip' ;
143- var output = fs . createWriteStream ( zipFile ) ;
144- var archive = archiver ( 'zip' , {
145- zlib : { level : 9 } // Sets the compression level.
146- } ) ;
141+ return new Promise ( function ( resolve /*, reject*/ ) {
142+ var path = 'gh-pages/' + pkg . dir + '/' ;
143+ var zipFile = 'hasplayer.js-v' + pkg . version + '.zip' ;
144+ var output = fs . createWriteStream ( zipFile ) ;
145+ var archive = archiver ( 'zip' , {
146+ zlib : { level : 9 } // Sets the compression level.
147+ } ) ;
147148
148- // archive.on('warning', function(err) {
149- // console.log('warning: ' + err);
150- // });
151-
152- // archive.on('error', function(err) {
153- // console.log('error: ' + err);
154- // });
155-
156- output . on ( 'close' , function ( ) {
157- console . log ( 'done' ) ;
158- fs . moveSync ( zipFile , path + zipFile , { overwrite : true } )
159- return Promise . resolve ( ) ;
160- } ) ;
149+ // archive.on('warning', function(err) {
150+ // console.log('warning: ' + err);
151+ // });
152+
153+ // archive.on('error', function(err) {
154+ // console.log('error: ' + err);
155+ // });
156+
157+ output . on ( 'close' , function ( ) {
158+ fs . moveSync ( zipFile , path + zipFile , { overwrite : true } )
159+ resolve ( ) ;
160+ } ) ;
161161
162- console . info ( 'Zip folder ' + path + ' into file ' + zipFile ) ;
163- archive . pipe ( output ) ;
164- archive . directory ( path , false ) ;
165- archive . finalize ( ) ;
162+ console . info ( 'Zip folder ' + path + ' into file ' + zipFile ) ;
163+ archive . pipe ( output ) ;
164+ archive . directory ( path , false ) ;
165+ archive . finalize ( ) ;
166+ } ) ;
166167} )
167168
168169// 7 - Add, commit and push changes on gh-pages branch to repository
@@ -183,7 +184,7 @@ getBranchName().then(
183184 fs . writeFileSync ( path , index ) ;
184185
185186 // Update 'latest' symbolic link
186- fs . removeSync ( 'gh-pages/ latest') ;
187+ console . info ( 'Update \' latest\' symbolic link ') ;
187188 fs . ensureSymlinkSync ( 'gh-pages/' + pkg . dir , 'gh-pages/latest' ) ;
188189 }
189190 }
0 commit comments