Skip to content

Commit

Permalink
Fix #140: accept path or file as :dir arg (#141)
Browse files Browse the repository at this point in the history
* Fix #140: accept path or file as :dir arg

* fix
  • Loading branch information
borkdude committed Jun 29, 2023
1 parent b912d8e commit d76129b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/babashka/process.cljc
Expand Up @@ -237,6 +237,7 @@
:env
:extra-env
:escape]} opts
dir (some-> dir str) ;; convert Path or File into String
str-fn (comp escape str)
cmd (mapv str-fn cmd)
cmd (if-let [program-resolver (:program-resolver opts)]
Expand Down
2 changes: 1 addition & 1 deletion test/babashka/process_test.cljc
Expand Up @@ -162,7 +162,7 @@
;; It would be nice to use clojure, but on Windows the official install
;; is still currently a PowerShell Module, which cannot be spawned directly.
;; So we'll use java. This test assumes that java and javac are on the PATH."
(let [test-dir "target/process-dir-option-test"
(let [test-dir (fs/path "target/process-dir-option-test")
java (fs/which "java")
java-dir (-> java fs/parent fs/canonicalize str)
java-src (-> (fs/file test-dir "UserDir.java") str)
Expand Down

0 comments on commit d76129b

Please sign in to comment.