@@ -11,10 +11,11 @@ import { existsSync, readdirSync } from "fs";
1111export const signZXP = async (
1212 config : CEP_Config ,
1313 input : string ,
14- zxpDir : string ,
14+ zxpFile : string ,
1515 tmpDir : string ,
1616) => {
1717 const zxpCmd = os . platform ( ) == "win32" ? `ZXPSignCmd` : `./ZXPSignCmd` ;
18+ zxpFile = zxpFile + ".zxp" ;
1819
1920 if ( os . platform ( ) === "darwin" ) {
2021 const zxpsignCmdPath = path . join ( __dirname , ".." , "bin" , "ZXPSignCmd" ) ;
@@ -29,13 +30,13 @@ export const signZXP = async (
2930
3031 const name = config . id ;
3132 const data = config . zxp ;
32- const output = path . join ( zxpDir , ` ${ name } .zxp` ) ;
33+ const zxpDir = path . dirname ( zxpFile ) ;
3334 const certPath = path . join ( tmpDir , `${ name } -cert.p12` ) ;
3435 const signPrepStr = `${ zxpCmd } -selfSignedCert ${ data . country } ${ data . province } ${ data . org } ${ name } ${ data . password } "${ certPath } "` ;
3536 const cwdDir = path . join ( __dirname , ".." , "bin" ) ;
3637
3738 removeIfExists ( certPath ) ;
38- removeIfExists ( output ) ;
39+ removeIfExists ( zxpFile ) ;
3940 safeCreate ( zxpDir ) ;
4041 console . log ( { signPrepStr } ) ;
4142 execSync ( signPrepStr , { cwd : cwdDir , encoding : "utf-8" } ) ;
@@ -47,7 +48,7 @@ export const signZXP = async (
4748 await pause ( 100 ) ;
4849 }
4950
50- let signStr = `${ zxpCmd } -sign "${ input } " "${ output } " "${ certPath } " ${ data . password } ` ;
51+ let signStr = `${ zxpCmd } -sign "${ input } " "${ zxpFile } " "${ certPath } " ${ data . password } ` ;
5152
5253 let numTSAs = 0 ;
5354 if ( data . tsa ) {
@@ -95,6 +96,6 @@ export const signZXP = async (
9596 }
9697 }
9798
98- log ( "built zxp" , true , output ) ;
99- return output ;
99+ log ( "built zxp" , true , zxpFile ) ;
100+ return zxpFile ;
100101} ;
0 commit comments