diff --git a/mod.test.ts b/mod.test.ts index 4ccc1e2..d63d6f1 100644 --- a/mod.test.ts +++ b/mod.test.ts @@ -2271,6 +2271,11 @@ Deno.test("expect error undefined", async () => { }); }); +Deno.test("resolve command by path", async () => { + const version = await $`${Deno.execPath()} --version`.text(); + assert(typeof version === "string"); +}); + function ensurePromiseNotResolved(promise: Promise) { return new Promise((resolve, reject) => { promise.then(() => reject(new Error("Promise was resolved"))); diff --git a/src/path.ts b/src/path.ts deleted file mode 100644 index e69de29..0000000 diff --git a/src/shell.ts b/src/shell.ts index 5f7ecaa..114c43f 100644 --- a/src/shell.ts +++ b/src/shell.ts @@ -1174,7 +1174,7 @@ interface UnresolvedCommand { } async function resolveCommand(unresolvedCommand: UnresolvedCommand, context: Context): Promise { - if (unresolvedCommand.name.includes("/")) { + if (unresolvedCommand.name.includes("/") || Deno.build.os === "windows" && unresolvedCommand.name.includes("\\")) { const commandPath = path.isAbsolute(unresolvedCommand.name) ? unresolvedCommand.name : path.resolve(unresolvedCommand.baseDir, unresolvedCommand.name);