Skip to content

Commit af45089

Browse files
committed
fix(zip): support for macos
1 parent 298b39f commit af45089

3 files changed

Lines changed: 29 additions & 3 deletions

File tree

deno.lock

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/compress.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { copy, ensureFile, Tar, ZipWriter } from "./deps.ts";
1+
import { copy, ensureFile, slash, Tar, ZipWriter } from "./deps.ts";
22

33
export async function tar(files: string[], output: string) {
44
const tar = new Tar();
55
for await (
66
const file of files
77
) {
88
await tar.append(file, {
9-
filePath: file,
9+
filePath: slash(file),
1010
});
1111
}
1212
await ensureFile(output);
@@ -33,7 +33,7 @@ export async function zip(
3333
const { useWebWorkers = false } = options || {};
3434
const promises = files.map(async (file) => {
3535
using fd = await Deno.open(file, { read: true });
36-
await zipWriter.add(file, fd, {
36+
await zipWriter.add(slash(file), fd, {
3737
useWebWorkers,
3838
});
3939
});

src/deps.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ export {
3131
} from "https://deno.land/x/zipjs@v2.7.34/index.js";
3232
export type { Entry } from "https://deno.land/x/zipjs@v2.7.34/index.d.ts";
3333
export { noop } from "https://deno.land/x/easy_std@v0.8.0/src/fn.ts";
34+
export { slash } from "https://deno.land/x/easy_std@v0.8.0/src/path.ts";

0 commit comments

Comments
 (0)