This repository was archived by the owner on Sep 10, 2019. It is now read-only.
File tree 3 files changed +15
-5
lines changed
3 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -105,10 +105,12 @@ export const handler = async ({
105
105
} ;
106
106
107
107
cleanup ( ( exitCode , signal ) => {
108
- log ( ' -> cleaning up temporary files' ) ;
109
108
// Delete the temporary directory.
110
- cleanUpTempDir ( ) . then ( ( ) => {
111
- success ( 'Successfully shut down. Thanks for using GrAMPS!' ) ;
109
+ cleanUpTempDir ( ) . then ( shouldPrintShutdownMessage => {
110
+ if ( shouldPrintShutdownMessage ) {
111
+ success ( 'Successfully shut down. Thanks for using GrAMPS!' ) ;
112
+ }
113
+
112
114
process . kill ( process . pid , signal ) ;
113
115
} ) ;
114
116
Original file line number Diff line number Diff line change @@ -4,5 +4,5 @@ import dev from './dev';
4
4
5
5
yargs
6
6
. command ( dev )
7
- // .demandCommand()
7
+ . demandCommand ( )
8
8
. help ( ) . argv ;
Original file line number Diff line number Diff line change @@ -31,7 +31,15 @@ const getDirName = dir =>
31
31
. slice ( - 1 )
32
32
. pop ( ) ;
33
33
34
- export const cleanUpTempDir = ( ) => del ( TEMP_DIR , { force : true } ) ;
34
+ export const cleanUpTempDir = ( ) => {
35
+ if ( fs . existsSync ( TEMP_DIR ) ) {
36
+ log ( ' -> cleaning up temporary files' ) ;
37
+ return del ( TEMP_DIR , { force : true } ) ;
38
+ }
39
+
40
+ // If there’s no temp dir, return a resolved promise (basically a no-op).
41
+ return Promise . resolve ( false ) ;
42
+ } ;
35
43
36
44
const makeTempDir = tmpDir =>
37
45
new Promise ( ( resolve , reject ) => {
You can’t perform that action at this time.
0 commit comments