Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Windows issues with spaces #43

Merged
merged 8 commits into from
Apr 16, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
small optimization
borkdude committed Apr 13, 2021
commit 99c3afb543eda63d7b69754a5683d93b715d129a
8 changes: 5 additions & 3 deletions src/borkdude/deps.clj
Original file line number Diff line number Diff line change
@@ -148,11 +148,13 @@ For more info, see:
(str/lower-case)
(str/includes? "windows")))

(def win? (delay (windows?)))

(defn double-quote
"Double quotes shell arguments on Windows. On other platforms it just
passes through the string."
[s]
(if (windows?)
(if @win?
(format "\"\"%s\"\"" s)
s))

@@ -178,7 +180,7 @@ For more info, see:
(recur (rest paths))))))))

(defn home-dir []
(if (windows?)
(if @win?
;; workaround for https://github.com/oracle/graal/issues/1630
(System/getenv "userprofile")
(System/getProperty "user.home")))
@@ -294,7 +296,7 @@ For more info, see:
s))

(defn -main [& command-line-args]
(let [windows? (windows?)
(let [windows? @win?
args (loop [command-line-args (seq command-line-args)
acc {:mode :repl}]
(if command-line-args