Skip to content

Commit 4e1f333

Browse files
committed
Add os-name and os-type to orchard.misc
1 parent 55e0e72 commit 4e1f333

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/orchard/misc.clj

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,19 @@
33
[clojure.java.io :as io]
44
[clojure.string :as str]))
55

6+
(def os-name
7+
(str/lower-case (System/getProperty "os.name")))
8+
9+
(def os-type
10+
(condp #(str/includes? %2 %1) os-name
11+
"linux" ::os-linux
12+
"mac" ::os-mac
13+
"windows" ::os-windows
14+
"bsd" ::os-bsd
15+
::os-not-supported))
16+
617
(defn os-windows? []
7-
(.startsWith (System/getProperty "os.name") "Windows"))
18+
(= ::os-windows os-type))
819

920
(defn boot-fake-classpath
1021
"Retrieve Boot's fake classpath.

0 commit comments

Comments
 (0)