@@ -9,6 +9,7 @@ import { addAnnotation } from 'azure-actions-appservice-rest/Utilities/Annotatio
99
1010import fs from 'fs' ;
1111import path from 'path' ;
12+ import { dir } from 'console' ;
1213
1314export class WebAppDeploymentProvider extends BaseWebAppDeploymentProvider {
1415
@@ -90,6 +91,7 @@ export class WebAppDeploymentProvider extends BaseWebAppDeploymentProvider {
9091
9192 // Ignore if the app is not a Linux app or if release.zip does not exist
9293 if ( ! this . actionParams . isLinux || ! fs . existsSync ( releaseZipPath ) ) {
94+ core . info ( `release.zip does not exist or not a Linux app, skipping deletion: ${ releaseZipPath } ` ) ;
9395 return ;
9496 }
9597
@@ -104,7 +106,7 @@ export class WebAppDeploymentProvider extends BaseWebAppDeploymentProvider {
104106
105107 try {
106108 await fs . promises . unlink ( releaseZipPath ) ;
107- core . debug ( `Deleted release.zip` ) ;
109+ core . info ( `Deleted release.zip` ) ;
108110 } catch ( error ) {
109111 core . debug ( `Error while deleting release.zip for Linux PHP app: ${ error } ` ) ;
110112 }
@@ -116,17 +118,29 @@ export class WebAppDeploymentProvider extends BaseWebAppDeploymentProvider {
116118 // Check if the webPackage folder contains a composer.json file
117119 const composerFile = 'composer.json' ;
118120 if ( fs . existsSync ( path . join ( webPackage , composerFile ) ) ) {
121+ core . info ( `Detected PHP app by presence of ${ composerFile } ` ) ;
119122 return true ;
120123 }
121124
122125 // Check if the webPackage folder contains a .php file
123- const hasPhpFiles = fs . readdirSync ( webPackage ) . some ( file => file . endsWith ( '.php' ) ) ;
126+ core . info ( `Checking for .php files in the web package directory: ${ webPackage } ` ) ;
127+ const hasPhpFiles = fs . readdirSync ( webPackage , { withFileTypes : true , recursive : true } ) . some ( file => file . isFile ( ) && file . name . endsWith ( '.php' ) ) ;
128+
129+ // const entries = fs.readdirSync(webPackage, { withFileTypes: true, recursive: true });
130+ // return entries.some(entry => entry.isFile() && entry.name.endsWith('.php'));
131+
132+ if ( hasPhpFiles ) {
133+ core . info ( `Detected PHP app by presence of .php files` ) ;
134+ } else {
135+ core . info ( `No .php files found in the web package directory.` ) ;
136+ }
124137
125138 return hasPhpFiles ;
126139 } catch ( error ) {
127- core . debug ( `Error while checking if the app is PHP: ${ error } ` ) ;
140+ core . info ( `Error while checking if the app is PHP: ${ error } ` ) ;
128141 }
129142
130143 return false ;
131144 }
145+
132146}
0 commit comments