File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -466,17 +466,19 @@ export class FcFunction extends FcDeploy<FunctionConfig> {
466
466
if ( codeUri ) {
467
467
codeAbsPath = path . resolve ( baseDir , codeUri ) ;
468
468
469
- let needZipJar = false ;
469
+ // 如果是官方的 runtime,那么不需要压缩
470
+ let notCompressJar = codeUri . endsWith ( '.jar' ) && ! isCustomRuntime ( this . localConfig ?. runtime ) ;
471
+ // 如果是 custom runtime,并且启动命令包含 java -jar 就需要压缩
470
472
if ( codeUri . endsWith ( '.jar' ) && isCustomRuntime ( this . localConfig ?. runtime ) ) {
471
473
const command = _ . get ( this . localConfig , 'customRuntimeConfig.command' , [ ] ) ;
472
474
const args = _ . get ( this . localConfig , 'customRuntimeConfig.args' , [ ] ) ;
473
475
const commandStr = `${ _ . join ( command , ' ' ) } ${ _ . join ( args , ' ' ) } ` ;
474
- needZipJar = ! commandStr . includes ( 'java -jar' ) ;
476
+ notCompressJar = ! commandStr . includes ( 'java -jar' ) ;
475
477
}
476
478
477
- this . logger . debug ( `needZipJar : ${ needZipJar } ` ) ;
479
+ this . logger . debug ( `notCompressJar : ${ notCompressJar } ` ) ;
478
480
479
- if ( codeUri . endsWith ( '.zip' ) || needZipJar || codeUri . endsWith ( '.war' ) ) {
481
+ if ( codeUri . endsWith ( '.zip' ) || notCompressJar || codeUri . endsWith ( '.war' ) ) {
480
482
const zipFileSizeInBytes : number = await getFileSize ( codeAbsPath ) ;
481
483
return {
482
484
filePath : codeAbsPath ,
You can’t perform that action at this time.
0 commit comments