File tree Expand file tree Collapse file tree 1 file changed +17
-10
lines changed
Expand file tree Collapse file tree 1 file changed +17
-10
lines changed Original file line number Diff line number Diff line change 11const zip = require ( 'bestzip' ) ;
22const package = require ( './package.json' ) ;
3+ const fs = require ( 'fs' ) ;
34
45console . log ( 'Zipping started:' ) ;
6+ const newPath = `./nt-dashboard_v${ package . version } .zip` ;
57
6- zip ( {
7- source : 'build/*' ,
8- destination : `nt-dashboard_v${ package . version } .zip` ,
9- } )
10- . then ( function ( ) {
11- console . log ( 'Zipped up!' ) ;
8+ try {
9+ fs . unlinkSync ( newPath ) ;
10+ zip ( {
11+ source : './build/*' ,
12+ destination : newPath ,
1213 } )
13- . catch ( function ( err ) {
14- console . error ( err . stack ) ;
15- process . exit ( 1 ) ;
16- } ) ;
14+ . then ( function ( ) {
15+ console . log ( 'Zipped up!' ) ;
16+ } )
17+ . catch ( function ( err ) {
18+ console . error ( err . stack ) ;
19+ process . exit ( 1 ) ;
20+ } ) ;
21+ } catch ( e ) {
22+ console . error ( e . stack ) ;
23+ }
You can’t perform that action at this time.
0 commit comments