Skip to content

Commit

Permalink
Updated and tested build.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanisham committed Feb 11, 2024
1 parent 67f1481 commit a30c6a0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
14 changes: 7 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/zig-cache
/zig-out
/build
/dist
/demo
zig-cache/
zig-out/
build/
dist/
demo/
zvm
testdata
.env
testdata/
.env*
12 changes: 7 additions & 5 deletions build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,21 @@ for (const os of GOOS) {
}
const zvm_str = `zvm-${os}-${ar}`;

if (os == "windows") {
console.time(`Compress zvm: ${zvm_str}`);
if (os === "windows") {
console.time(`Compress zvm (zip): ${zvm_str}`);
const zip = new Deno.Command(`zip`, {
args: [`${zvm_str}.zip`, `${zvm_str}/zvm.exe`],
stdin: "piped",
stdout: "piped",
});

zip.spawn();
console.timeEnd(`Compress zvm: ${zvm_str}`);

console.timeEnd(`Compress zvm (zip): ${zvm_str}`);
continue;
}
const tar = new Tar();
console.time(`Compress zvm: ${zvm_str}`);
console.time(`Compress zvm (tar): ${zvm_str}`);
await tar.append("zvm", {
filePath: `${zvm_str}/zvm`,
});
Expand All @@ -83,7 +85,7 @@ for (const os of GOOS) {
});
await copy(tar.getReader(), writer);
writer.close();
console.timeEnd(`Compress zvm: ${zvm_str}`);
console.timeEnd(`Compress zvm (tar): ${zvm_str}`);
}
}

Expand Down

0 comments on commit a30c6a0

Please sign in to comment.