From 80c00d6ebaf99ffdd927d24a013e66d6e2524971 Mon Sep 17 00:00:00 2001 From: Christopher Monsanto Date: Fri, 7 Aug 2020 05:08:07 -0400 Subject: [PATCH] deploy: ignore dir in input to copy --- tools/deploy/index.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/deploy/index.ts b/tools/deploy/index.ts index ded1e5bf..4c6a2812 100644 --- a/tools/deploy/index.ts +++ b/tools/deploy/index.ts @@ -36,8 +36,13 @@ program for (const file of files) { const src = pathlib.path(file); - const result = scr.runOnFile(src); - const dst = pathlib.join(outputDir, pathlib.path(src, result)); + const input = pathlib.update(src, {dir: ""}); + const result = scr.runOnFile(input); + if (result === undefined) { + throw new Error(`undefined output on ${file}`); + } + const output = pathlib.path(input, result); + const dst = pathlib.join(outputDir, output); aq.copy(src, dst); }