diff --git a/scripts/package_lambdas.mjs b/scripts/package_lambdas.mjs index 9045676..f1b239b 100644 --- a/scripts/package_lambdas.mjs +++ b/scripts/package_lambdas.mjs @@ -8,7 +8,7 @@ import { spawn, spawnSync } from "node:child_process"; import { cpSync, existsSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs"; import { tmpdir } from "node:os"; -import { join } from "node:path"; +import { join, resolve } from "node:path"; import { fileURLToPath } from "node:url"; const ROOT = fileURLToPath(new URL("..", import.meta.url)); @@ -28,7 +28,7 @@ function parseArgs(argv) { if (arg === "--git-sha") { out.gitSha = argv[++i]; } else if (arg === "--out-dir") { - out.outDir = argv[++i]; + out.outDir = resolve(argv[++i]); } else if (arg === "--only") { out.only.push(argv[++i]); } else { @@ -69,7 +69,7 @@ async function build(name, gitSha, outDir) { throw new Error("npm ci --omit=dev failed"); } mkdirSync(outDir, { recursive: true }); - const zipPath = join(outDir, `${name}.zip`); + const zipPath = resolve(outDir, `${name}.zip`); rmSync(zipPath, { force: true }); await zipDir(dest, zipPath); return zipPath;