@@ -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,21 +91,23 @@ 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
9698 let isPhpApp = await this . checkIfTheAppIsPhpApp ( webPackage ) ;
9799
98100 // No need to delete release.zip for non-PHP apps
99101 if ( ! isPhpApp ) {
102+ core . info ( `Not a PHP app, skipping deletion of release.zip: ${ releaseZipPath } ` ) ;
100103 return ;
101104 }
102105
103106 // Delete release.zip if it exists
104107
105108 try {
106109 await fs . promises . unlink ( releaseZipPath ) ;
107- core . debug ( `Deleted release.zip` ) ;
110+ core . info ( `Deleted release.zip` ) ;
108111 } catch ( error ) {
109112 core . debug ( `Error while deleting release.zip for Linux PHP app: ${ error } ` ) ;
110113 }
@@ -116,17 +119,26 @@ export class WebAppDeploymentProvider extends BaseWebAppDeploymentProvider {
116119 // Check if the webPackage folder contains a composer.json file
117120 const composerFile = 'composer.json' ;
118121 if ( fs . existsSync ( path . join ( webPackage , composerFile ) ) ) {
122+ core . info ( `Detected PHP app by presence of ${ composerFile } ` ) ;
119123 return true ;
120124 }
121125
122126 // Check if the webPackage folder contains a .php file
123- const hasPhpFiles = fs . readdirSync ( webPackage ) . some ( file => file . endsWith ( '.php' ) ) ;
127+ core . info ( `Checking for .php files in the web package directory: ${ webPackage } ` ) ;
128+ const hasPhpFiles = fs . readdirSync ( webPackage , { withFileTypes : true , recursive : true } ) . some ( file => file . isFile ( ) && file . name . endsWith ( '.php' ) ) ;
129+
130+ if ( hasPhpFiles ) {
131+ core . info ( `Detected PHP app by presence of .php files` ) ;
132+ } else {
133+ core . info ( `No .php files found in the web package directory.` ) ;
134+ }
124135
125136 return hasPhpFiles ;
126137 } catch ( error ) {
127- core . debug ( `Error while checking if the app is PHP: ${ error } ` ) ;
138+ core . info ( `Error while checking if the app is PHP: ${ error } ` ) ;
128139 }
129140
130141 return false ;
131142 }
143+
132144}
0 commit comments