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

Function packWrapperPackage

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

Source from the content-addressed store, hash-verified

118};
119
120const packWrapperPackage = async (): Promise<string> => {
121 if (!existsSync(wrapperDir)) {
122 throw new Error(`Wrapper package directory not found: ${wrapperDir}`);
123 }
124
125 await mkdir(releaseDir, { recursive: true });
126
127 const before = new Set((await readdir(wrapperDir)).filter((entry) => entry.endsWith(".tgz")));
128 await runCommand({
129 command: "bun",
130 args: ["pm", "pack"],
131 cwd: wrapperDir,
132 });
133
134 const after = (await readdir(wrapperDir)).filter((entry) => entry.endsWith(".tgz"));
135 const archiveName = after.find((entry) => !before.has(entry)) ?? after[0];
136
137 if (!archiveName) {
138 throw new Error(`bun pm pack did not create a .tgz archive in ${wrapperDir}`);
139 }
140
141 const sourcePath = join(wrapperDir, archiveName);
142 const destinationPath = join(releaseDir, archiveName);
143
144 await rm(destinationPath, { force: true });
145 await rename(sourcePath, destinationPath);
146
147 return destinationPath;
148};
149
150const collectReleaseAssetPaths = async (
151 wrapperArchivePath: string,

Callers 1

mainFunction · 0.85

Calls 1

runCommandFunction · 0.70

Tested by

no test coverage detected