@@ -91,17 +91,30 @@ function _cleanPhoenixProGitFolder() {
9191
9292function _deletePhoenixProSourceFolder ( ) {
9393 return new Promise ( ( resolve ) => {
94- const phoenixProFolders = [
95- 'dist/extensionsIntegrated/phoenix-pro' ,
96- 'dist-test/src/extensionsIntegrated/phoenix-pro'
97- ] ;
94+ // 1. Delete everything in dist folder
95+ const distFolder = 'dist/extensionsIntegrated/phoenix-pro' ;
96+ if ( fs . existsSync ( distFolder ) ) {
97+ fs . rmSync ( distFolder , { recursive : true , force : true } ) ;
98+ console . log ( `Deleted phoenix-pro source folder: ${ distFolder } ` ) ;
99+ }
98100
99- for ( const folder of phoenixProFolders ) {
100- if ( fs . existsSync ( folder ) ) {
101- fs . rmSync ( folder , { recursive : true , force : true } ) ;
102- console . log ( `Deleted phoenix-pro source folder: ${ folder } ` ) ;
101+ // 2. Selectively delete in dist-test folder, keeping test files
102+ const distTestFolder = 'dist-test/src/extensionsIntegrated/phoenix-pro' ;
103+ if ( fs . existsSync ( distTestFolder ) ) {
104+ const items = fs . readdirSync ( distTestFolder ) ;
105+ const keepItems = [ 'unittests.js' , 'unit-tests' ] ;
106+
107+ for ( const item of items ) {
108+ if ( keepItems . includes ( item ) ) {
109+ console . log ( `Retained for testing: ${ distTestFolder } /${ item } ` ) ;
110+ } else {
111+ const itemPath = path . join ( distTestFolder , item ) ;
112+ fs . rmSync ( itemPath , { recursive : true , force : true } ) ;
113+ console . log ( `Deleted: ${ itemPath } ` ) ;
114+ }
103115 }
104116 }
117+
105118 resolve ( ) ;
106119 } ) ;
107120}
0 commit comments