| 201 | |
| 202 | // ./file-zip -mode 2 --zipPath aaa.zip --DistDirPath 123412124 --code GBK |
| 203 | async function useUnzip(sourceZip: string, destDir: string, code = "utf-8"): Promise<boolean> { |
| 204 | const params = [ |
| 205 | "--mode=2", |
| 206 | `--zipPath=${path.basename(sourceZip)}`, |
| 207 | `--distDirPath=${path.normalize(destDir)}`, |
| 208 | `--code=${code}` |
| 209 | ]; |
| 210 | logger.info(`Function useUnzip(): Command: ${GOLANG_ZIP_PATH} ${params.join(" ")}`); |
| 211 | const subProcess = new ProcessWrapper( |
| 212 | GOLANG_ZIP_PATH, |
| 213 | params, |
| 214 | path.dirname(sourceZip), |
| 215 | ZIP_TIMEOUT_SECONDS, |
| 216 | code |
| 217 | ); |
| 218 | subProcess.setErrMsg(COMPRESS_ERROR_MSG); |
| 219 | return subProcess.start(); |
| 220 | } |
| 221 | |
| 222 | // ./file-zip -mode 1 --file main.go --file file-zip --file 123 --file README.md --zipPath aaabb.zip |
| 223 | async function useZip(distZip: string, files: string[], code = "utf-8"): Promise<boolean> { |