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

Function useZip

daemon/src/common/compress.ts:223–243  ·  view source on GitHub ↗
(distZip: string, files: string[], code = "utf-8")

Source from the content-addressed store, hash-verified

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> {
224 if (!files || files.length == 0) throw new Error(t("TXT_CODE_2038ec2c"));
225 const params = ["--mode=1", `--code=${code}`, `--zipPath=${path.basename(distZip)}`];
226 files.forEach((v) => {
227 params.push(`--file=${path.basename(v)}`);
228 });
229 logger.info(
230 `Function useZip(): Command: ${GOLANG_ZIP_PATH} ${params.join(" ")}, CWD: ${path.dirname(
231 distZip
232 )}`
233 );
234 const subProcess = new ProcessWrapper(
235 GOLANG_ZIP_PATH,
236 params,
237 path.dirname(distZip),
238 ZIP_TIMEOUT_SECONDS,
239 code
240 );
241 subProcess.setErrMsg(COMPRESS_ERROR_MSG);
242 return subProcess.start();
243}

Callers 1

compressFunction · 0.85

Calls 4

setErrMsgMethod · 0.95
startMethod · 0.95
infoMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected