Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packaging/assemble.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ async function copyBinary(source, destination, executable = true) {
await mkdir(resolve(destination, ".."), { recursive: true });
await cp(source, destination);
if (executable && !destination.endsWith(".exe")) await chmod(destination, 0o755);
if (!executable) await chmod(destination, 0o644);
}

async function validateBinaries(directory) {
Expand Down
4 changes: 3 additions & 1 deletion packaging/assemble.test.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import test from "node:test";
import assert from "node:assert/strict";
import { mkdtemp, mkdir, readFile, rm, writeFile } from "node:fs/promises";
import { mkdtemp, mkdir, readFile, rm, stat, writeFile } from "node:fs/promises";
import { join } from "node:path";
import { tmpdir } from "node:os";
import { assemble, isPackageVersion } from "./assemble.mjs";
Expand Down Expand Up @@ -84,6 +84,8 @@ test("assembles one public npm package and six matching npm and Python runtimes"
assert.doesNotMatch(rustManifest, /registry\s*=/);
assert.match(await readFile(join(rustRoot, "README.md"), "utf8"), /installed automatically by `yieldskill`/);
assert.match(await readFile(join(rustRoot, "LICENSE"), "utf8"), /MIT License/);
const rustRuntime = target.goos === "windows" ? "yskill.exe" : "yskill";
assert.equal((await stat(join(rustRoot, "runtime", rustRuntime))).mode & 0o111, 0);
}

const rustMain = join(output, "rust/yieldskill");
Expand Down