mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
parent
ce950d78f4
commit
6fb2e78151
2 changed files with 3 additions and 2 deletions
|
|
@ -31,10 +31,10 @@ function packPackages(packages, tarballDirectory) {
|
|||
stdio: ["inherit", "pipe", "inherit"],
|
||||
});
|
||||
const parsed = JSON.parse(output);
|
||||
if (!Array.isArray(parsed) || parsed.length !== 1 || !parsed[0]?.filename) {
|
||||
const packed = Array.isArray(parsed) ? (parsed.length === 1 ? parsed[0] : undefined) : parsed?.[pkg.name];
|
||||
if (packed?.name !== pkg.name || typeof packed.filename !== "string") {
|
||||
throw new Error(`npm pack returned an unexpected result for ${pkg.name}`);
|
||||
}
|
||||
const packed = parsed[0];
|
||||
|
||||
const originalPath = join(tarballDirectory, packed.filename);
|
||||
const contents = readFileSync(originalPath);
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ function writePackage(directory, manifest, files) {
|
|||
}
|
||||
}
|
||||
|
||||
// #10633: Covers npm 12's package-keyed `npm pack --json` output only when npm 12 is on PATH.
|
||||
test("produces a verified, content-addressed artifact set", (t) => {
|
||||
const temporaryRoot = mkdtempSync(join(tmpdir(), "pi-package-artifacts-test-"));
|
||||
t.after(() => rmSync(temporaryRoot, { recursive: true, force: true }));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue