@@ -77,8 +77,8 @@ class WebAppDeploymentProvider extends BaseWebAppDeploymentProvider_1.BaseWebApp
7777 break ;
7878 case packageUtility_1 . PackageType . folder :
7979 let tempPackagePath = utility . generateTemporaryFolderOrZipPath ( `${ process . env . RUNNER_TEMP } ` , false ) ;
80- // excluding release.zip while creating zip for deployment if it's a Linux PHP app
81- yield this . deleteReleaseZipForLinuxPhpApps ( webPackage ) ;
80+ // Excluding release.zip while creating zip for deployment if it's a Linux app
81+ yield this . deleteReleaseZipForLinuxApps ( webPackage ) ;
8282 webPackage = ( yield zipUtility . archiveFolder ( webPackage , "" , tempPackagePath ) ) ;
8383 core . debug ( "Compressed folder into zip " + webPackage ) ;
8484 core . debug ( "Initiated deployment via kudu service for webapp package : " + webPackage ) ;
@@ -119,58 +119,27 @@ class WebAppDeploymentProvider extends BaseWebAppDeploymentProvider_1.BaseWebApp
119119 core . setOutput ( 'webapp-url' , this . applicationURL ) ;
120120 } ) ;
121121 }
122- deleteReleaseZipForLinuxPhpApps ( webPackage ) {
122+ deleteReleaseZipForLinuxApps ( webPackage ) {
123123 return __awaiter ( this , void 0 , void 0 , function * ( ) {
124- // Ignore if the app is not a Linux app or if release.zip does not exist
124+ // Ignore if the app is not a Linux app
125125 if ( ! this . actionParams . isLinux ) {
126126 core . debug ( `It's not a Linux app, skipping deletion of release.zip` ) ;
127127 return ;
128128 }
129129 const releaseZipPath = path_1 . default . join ( webPackage , 'release.zip' ) ;
130+ // Check if release.zip exists
130131 if ( ! fs_1 . default . existsSync ( releaseZipPath ) ) {
131132 core . debug ( `release.zip does not exist, skipping deletion: ${ releaseZipPath } ` ) ;
132133 return ;
133134 }
134- let isPhpApp = yield this . checkIfTheAppIsPhpApp ( webPackage ) ;
135- // No need to delete release.zip for non-PHP apps
136- if ( ! isPhpApp ) {
137- core . debug ( `Not a PHP app, skipping deletion of release.zip: ${ releaseZipPath } ` ) ;
138- return ;
139- }
140135 // Delete release.zip if it exists
141136 try {
142137 yield fs_1 . default . promises . unlink ( releaseZipPath ) ;
143138 core . debug ( `Deleted release.zip` ) ;
144139 }
145140 catch ( error ) {
146- core . debug ( `Error while deleting release.zip for Linux PHP app: ${ error } ` ) ;
147- }
148- } ) ;
149- }
150- checkIfTheAppIsPhpApp ( webPackage ) {
151- return __awaiter ( this , void 0 , void 0 , function * ( ) {
152- try {
153- // Check if the webPackage folder contains a composer.json file
154- const composerFile = 'composer.json' ;
155- if ( fs_1 . default . existsSync ( path_1 . default . join ( webPackage , composerFile ) ) ) {
156- core . debug ( `Detected PHP app by presence of ${ composerFile } ` ) ;
157- return true ;
158- }
159- // Check if the webPackage folder contains a .php file
160- core . debug ( `Checking for .php files in the web package directory: ${ webPackage } ` ) ;
161- const hasPhpFiles = fs_1 . default . readdirSync ( webPackage , { withFileTypes : true , recursive : true } ) . some ( file => file . isFile ( ) && file . name . endsWith ( '.php' ) ) ;
162- if ( hasPhpFiles ) {
163- core . debug ( `Detected PHP app by presence of .php files` ) ;
164- }
165- else {
166- core . debug ( `No .php files found in the web package directory.` ) ;
167- }
168- return hasPhpFiles ;
169- }
170- catch ( error ) {
171- core . debug ( `Error while checking if the app is PHP: ${ error } ` ) ;
141+ core . debug ( `Error while deleting release.zip for Linux app: ${ error } ` ) ;
172142 }
173- return false ;
174143 } ) ;
175144 }
176145}
0 commit comments