mirror of
https://github.com/denoland/deno.git
synced 2024-11-25 15:29:32 -05:00
fix(windows): Deno.Command - align binary resolution with linux and mac (#25429)
This commit is contained in:
parent
c6d1b0a1cc
commit
5400f1af6c
1 changed files with 32 additions and 0 deletions
|
@ -975,3 +975,35 @@ Deno.test(
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Deno.test(
|
||||||
|
{ permissions: { write: true, run: true, read: true } },
|
||||||
|
async function commandWithCwdOrPath() {
|
||||||
|
const cwd = Deno.makeTempDirSync({ prefix: "deno_command_test" });
|
||||||
|
try {
|
||||||
|
const suffix = Deno.build.os === "windows" ? ".exe" : "";
|
||||||
|
Deno.mkdirSync(`${cwd}/subdir`);
|
||||||
|
Deno.copyFileSync(Deno.execPath(), `${cwd}/subdir/my_binary${suffix}`);
|
||||||
|
// cwd
|
||||||
|
{
|
||||||
|
const output = await new Deno.Command(`./my_binary${suffix}`, {
|
||||||
|
cwd: `${cwd}/subdir`,
|
||||||
|
args: ["-v"],
|
||||||
|
}).output();
|
||||||
|
assertEquals(output.success, true);
|
||||||
|
}
|
||||||
|
// path
|
||||||
|
{
|
||||||
|
const output = await new Deno.Command(`my_binary${suffix}`, {
|
||||||
|
env: {
|
||||||
|
PATH: `${cwd}/subdir`,
|
||||||
|
},
|
||||||
|
args: ["-v"],
|
||||||
|
}).output();
|
||||||
|
assertEquals(output.success, true);
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
Deno.removeSync(cwd, { recursive: true });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
Loading…
Reference in a new issue