Skip to content

Commit

Permalink
fix(command): external commands not working on windows (#224)
Browse files Browse the repository at this point in the history
  • Loading branch information
rbeesley committed Jul 3, 2021
1 parent f3103b9 commit 84ac5be
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion command/command.ts
Expand Up @@ -1037,6 +1037,9 @@ export class Command<
// deno-lint-ignore no-explicit-any
const parts: string[] = (Deno as any).mainModule.replace(/^file:\/\//g, "")
.split("/");
if (Deno.build.os === "windows" && parts[0] === "") {
parts.shift();
}
parts.pop();
const path: string = parts.join("/");
files.push(
Expand Down Expand Up @@ -1075,7 +1078,7 @@ export class Command<
Deno.lstatSync(file);
} catch (error) {
if (error instanceof Deno.errors.NotFound) {
return false;
continue;
}
throw error;
}
Expand Down

0 comments on commit 84ac5be

Please sign in to comment.