diff --git a/deno.jsonc b/deno.jsonc index d9343ebc..70ab2af9 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -8,7 +8,9 @@ "run": "deno run --unstable -A ./entrypoint.ts", // you can specify paths to specific tests if you need - "test": "deno test --allow-read=$PWD,$TMPDIR,$HOME,/ --allow-env --allow-write=$TMPDIR --allow-ffi --unstable", + // follows is the ideal permissions lines, unfortunately deno considers making symlinks to require full read/write permissions for fuck knows why reasons + //"test": "deno test --allow-read=$PWD,$TMPDIR,$HOME,/ --allow-env --allow-write=$TMPDIR --allow-ffi --unstable", + "test": "deno test --allow-read --allow-env --allow-write --allow-ffi --unstable", // ^^ ffi & unstable needed for execve.ts // installs to /usr/local/bin/pkgx diff --git a/src/modes/internal.activate.test.ts b/src/modes/internal.activate.test.ts index 12cb2cfe..eecfa129 100644 --- a/src/modes/internal.activate.test.ts +++ b/src/modes/internal.activate.test.ts @@ -67,7 +67,7 @@ Deno.test("internal.activate.ts", async runner => { _internals.datadir() }) - await runner.step("apply_userenv", () => { + await runner.step("apply userenv", () => { const userenv = { PATH: "/foo/bar:$PATH" } const env = { PATH: "/baz:$PATH"} _internals.apply_userenv(env, userenv) diff --git a/src/utils/devenv.test.ts b/src/utils/devenv.test.ts index 2a8c1bd0..be62c76a 100644 --- a/src/utils/devenv.test.ts +++ b/src/utils/devenv.test.ts @@ -34,21 +34,26 @@ Deno.test("devenv.ts", async runner => { for (const [keyfile, dep] of keyfiles) { await test.step(`${keyfile}`, async () => { - const file = fixturesd.join(keyfile).cp({ into: Path.mktemp() }) - const { env, pkgs } = await specimen(file.parent()) - assert(pkgs.find(pkg => utils.pkg.str(pkg) == "zlib.net^1.2"), "should dep zlib^1.2") - if (dep) { - assert(pkgs.find(pkg => utils.pkg.str(pkg) == dep), `should dep ${dep}`) + const go = async (file: Path) => { + const { env, pkgs } = await specimen(file.parent()) + assert(pkgs.find(pkg => utils.pkg.str(pkg) == "zlib.net^1.2"), "should dep zlib^1.2") + if (dep) { + assert(pkgs.find(pkg => utils.pkg.str(pkg) == dep), `should dep ${dep}`) + } + + switch (keyfile) { + case 'package.json/str/package.json': + case 'package.json/arr/package.json': + case 'deno.json/arr/deno.json': + break // testing the short form for deps with these files + default: + assertEquals(env.FOO, "BAR") + } } - switch (keyfile) { - case 'package.json/str/package.json': - case 'package.json/arr/package.json': - case 'deno.json/arr/deno.json': - break // testing the short form for deps with these files - default: - assertEquals(env.FOO, "BAR") - } + const target = fixturesd.join(keyfile).cp({ into: Path.mktemp() }) + await go(target) + await go(Path.mktemp().join(target.basename()).ln('s', { target })) }) } }) diff --git a/src/utils/devenv.ts b/src/utils/devenv.ts index 4804ae97..1c69ffe7 100644 --- a/src/utils/devenv.ts +++ b/src/utils/devenv.ts @@ -19,8 +19,8 @@ export default async function(dir: Path) { const pkgs: PackageRequirement[] = [] const env: Record = {} - for await (const [path, {name, isFile, isDirectory}] of dir.ls()) { - if (isFile) { + for await (const [path, {name, isFile, isSymlink, isDirectory}] of dir.ls()) { + if (isFile || isSymlink) { switch (name) { case "deno.json": case "deno.jsonc":