File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed
Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change 1+ const fs = require ( "fs" ) ;
2+ const path = require ( "path" ) ;
3+
4+ const foldersToDelete = [ "src/app" , "src/app/styles" ] ;
5+
6+ function deleteFolder ( folderPath ) {
7+ if ( fs . existsSync ( folderPath ) ) {
8+ fs . readdirSync ( folderPath ) . forEach ( ( file ) => {
9+ const filePath = path . join ( folderPath , file ) ;
10+ if ( fs . lstatSync ( filePath ) . isDirectory ( ) ) {
11+ deleteFolder ( filePath ) ;
12+ } else {
13+ fs . unlinkSync ( filePath ) ;
14+ }
15+ } ) ;
16+ fs . rmdirSync ( folderPath ) ;
17+ console . log ( `${ folderPath } folder deleted successfully.` ) ;
18+ }
19+ }
20+
21+ foldersToDelete . forEach ( ( folderName ) => {
22+ const folderPath = path . join ( __dirname , folderName ) ;
23+ deleteFolder ( folderPath ) ;
24+ } ) ;
Original file line number Diff line number Diff line change 1515 "test" : " npm-run-all --parallel test-message dev-test" ,
1616 "dev-test" : " nodemon --exec babel-node spec/run.js" ,
1717 "CI-test" : " babel-node spec/run.js" ,
18- "test-message" : " node -r esm src/customize/testMessage"
18+ "test-message" : " node -r esm src/customize/testMessage" ,
19+ "cleanup" : " node cleanUp.js"
1920 },
2021 "repository" : {
2122 "type" : " git" ,
You can’t perform that action at this time.
0 commit comments