From d4ff6b1f401a856be28a95bd0f1f1d29e9717ea7 Mon Sep 17 00:00:00 2001 From: Waldemar Reusch Date: Sun, 5 Feb 2023 12:59:05 +0100 Subject: [PATCH] fix: bundler fix missing directory --- src/bin/tools/jar.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bin/tools/jar.ts b/src/bin/tools/jar.ts index 1ee53da9..62c99288 100644 --- a/src/bin/tools/jar.ts +++ b/src/bin/tools/jar.ts @@ -1,11 +1,12 @@ import { Readable, Transform } from "stream"; import { pipeline } from "stream/promises"; -import { relative, sep } from "path"; +import { dirname, relative, sep } from "path"; import { createWriteStream } from "fs"; import walk from "./walk"; import type { ZipSource } from "./zip"; import zip from "./zip"; +import { mkdir } from "fs/promises"; /** Trim leading whitespace from every line */ const trimIndent = (s: string) => s.replace(/(\n)\s+/g, "$1"); @@ -69,6 +70,7 @@ export default async function jar({ groupId, artifactId, version, rootPath, targ } }); + await mkdir(dirname(targetPath), { recursive: true }); /** * Create an async pipeline, wait until everything is fully processed */