MCPcopy Create free account
hub / github.com/MCSManager/MCSManager / useUnzip

Function useUnzip

daemon/src/common/compress.ts:203–220  ·  view source on GitHub ↗
(sourceZip: string, destDir: string, code = "utf-8")

Source from the content-addressed store, hash-verified

201
202// ./file-zip -mode 2 --zipPath aaa.zip --DistDirPath 123412124 --code GBK
203async 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
223async function useZip(distZip: string, files: string[], code = "utf-8"): Promise<boolean> {

Callers 1

tryUnzipFunction · 0.85

Calls 3

setErrMsgMethod · 0.95
startMethod · 0.95
infoMethod · 0.80

Tested by

no test coverage detected