babashka / process

Clojure library for shelling out / spawning sub-processes
Eclipse Public License 1.0
219 stars 29 forks source link

Resolve relative `program` to `:dir` on windows #127

Closed lread closed 1 year ago

lread commented 1 year ago

Java ProcessBuilder abstracts, but does not fully generalize, behaviour across underlying OS support for process creation. In the case of Windows, it does not resolve a program relative to the specified working dir. This results in file process creation errors due to the program not being found. This change resolves this nuance.

Bump babashka/fs to get updates to which.

Update internal and undocumented program-resolver fn signature. Formerly it expected program now it expects map with key :program and optionally key :dir.

Rewrote dir opt unit tests for better coverage. We should discover problems when run from babashka.process now rather than accidental coverage offered when running from babashka.

The exec function tests are still a work in progress, so did some manual testing by compiling changes into babashka to verify that changes did not break exec.

Also: fixed parse-args tests that was spawning os-specific 'ls' command. This test is not run from babashka, so we did not see the failure there, but it did fail locally for me. So switched to os-agnostic wee dummy wd.clj script for this one.

Closes #126

borkdude commented 1 year ago

Thanks!