diff --git a/src/bin/tools/jar.ts b/src/bin/tools/jar.ts index 4964ed72..a87e9048 100644 --- a/src/bin/tools/jar.ts +++ b/src/bin/tools/jar.ts @@ -48,7 +48,7 @@ export async function jarStream({ groupId, artifactId, version, asyncPathGenerat for await (const entry of asyncPathGeneratorFn()) { if ("buffer" in entry) { zipFile.addBuffer(entry.buffer, entry.zipPath); - } else if ("fsPath" in entry && entry.fsPath.endsWith(sep)) { + } else if ("fsPath" in entry && !entry.fsPath.endsWith(sep)) { zipFile.addFile(entry.fsPath, entry.zipPath); } } diff --git a/src/bin/tools/walk.ts b/src/bin/tools/walk.ts index f7c4dee0..5c1cd739 100644 --- a/src/bin/tools/walk.ts +++ b/src/bin/tools/walk.ts @@ -1,9 +1,9 @@ import { readdir } from "fs/promises"; -import { resolve } from "path"; +import { resolve, sep } from "path"; /** * Asynchronously and recursively walk a directory tree, yielding every file and directory - * found + * found. Directory paths will _always_ end with a path separator. * * @param root the starting directory * @returns AsyncGenerator @@ -12,8 +12,8 @@ export default async function* walk(root: string): AsyncGenerator