diff --git a/src/lib/utils/pack.ts b/src/lib/utils/pack.ts index 114381e..8286432 100644 --- a/src/lib/utils/pack.ts +++ b/src/lib/utils/pack.ts @@ -1,3 +1,4 @@ +import assert from "node:assert"; import { exec } from "node:child_process"; import fs from "node:fs"; import path from "node:path"; @@ -49,11 +50,13 @@ export async function pack(srcDir: string, dstDir: string) { }); const lastLine = stdout.trim().split("\n").at(-1); - if (!lastLine) { - throw new Error(`Failed to parse last line from stdout: ${stdout.trim()}`); - } + + assert(lastLine, `Failed to parse last line from stdout: ${stdout.trim()}`); + const fileName = path.basename(lastLine); + assert(fileName, `Failed to parse file name from: ${lastLine}`); + const filePath = path.join(dstDir, fileName); if (!fs.existsSync(filePath)) {