MCPcopy Create free account
hub / github.com/decaporg/decap-cms / packAll

Function packAll

scripts/smoke-install-packed.mjs:111–125  ·  view source on GitHub ↗
(packages, destination)

Source from the content-addressed store, hash-verified

109}
110
111function packAll(packages, destination) {
112 mkdirSync(destination, { recursive: true });
113 const tarballs = {};
114 for (const pkg of packages) {
115 const stdout = run(
116 `pack ${pkg.name}`,
117 `pnpm pack --pack-destination "${destination}" --json`,
118 pkg.path,
119 );
120 // pnpm may print lifecycle output before the JSON document.
121 const { filename } = JSON.parse(stdout.slice(stdout.indexOf('{')));
122 tarballs[pkg.name] = `file:${filename}`;
123 }
124 return tarballs;
125}
126
127function writeJson(path, value) {
128 writeFileSync(path, `${JSON.stringify(value, null, 2)}\n`);

Callers 1

mainFunction · 0.85

Calls 1

runFunction · 0.70

Tested by

no test coverage detected