MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / packWrapperPackage

Function packWrapperPackage

apps/cli/src/release.ts:145–173  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

143};
144
145const packWrapperPackage = async (): Promise<string> => {
146 if (!existsSync(wrapperDir)) {
147 throw new Error(`Wrapper package directory not found: ${wrapperDir}`);
148 }
149
150 await mkdir(releaseDir, { recursive: true });
151
152 const before = new Set((await readdir(wrapperDir)).filter((entry) => entry.endsWith(".tgz")));
153 await runCommand({
154 command: "bun",
155 args: ["pm", "pack"],
156 cwd: wrapperDir,
157 });
158
159 const after = (await readdir(wrapperDir)).filter((entry) => entry.endsWith(".tgz"));
160 const archiveName = after.find((entry) => !before.has(entry)) ?? after[0];
161
162 if (!archiveName) {
163 throw new Error(`bun pm pack did not create a .tgz archive in ${wrapperDir}`);
164 }
165
166 const sourcePath = join(wrapperDir, archiveName);
167 const destinationPath = join(releaseDir, archiveName);
168
169 await rm(destinationPath, { force: true });
170 await rename(sourcePath, destinationPath);
171
172 return destinationPath;
173};
174
175const collectReleaseAssetPaths = async (
176 wrapperArchivePath: string,

Callers 1

mainFunction · 0.85

Calls 1

runCommandFunction · 0.70

Tested by

no test coverage detected