dsherret / dax

Cross-platform shell tools for Deno and Node.js inspired by zx.
MIT License
965 stars 33 forks source link

Windows style path is not treated as a valid command. #273

Open mashizora opened 1 month ago

mashizora commented 1 month ago

In 0.40.0+, command not found error throws when calling an Windows executable file by Windows style path (separator is \\).

0.39.2 does not have this issue, It looks like an issue in deno-which implementation.

Reproduction

import { $ } from "jsr:@david/dax@0.41.0";

await $`c:\\Windows\\explorer.exe`; // error

Output

dax: c:\Windows\explorer.exe: command not found
error: Uncaught (in promise) Error: Exited with code: 127
            throw new Error(`Exited with code: ${code}`);
                  ^
    at CommandChild.pipedStdoutBuffer (https://jsr.io/@david/dax/0.41.0/src/command.ts:785:19)
    at eventLoopTick (ext:core/01_core.js:168:7)