Skip to content

Commit

Permalink
get cljd.build working on windows from powershell and cmd (#331)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen-J authored Dec 12, 2024
1 parent f8ccf12 commit 02d9d66
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions clj/src/cljd/build.clj
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,9 @@
out (.redirectOutput out)
dir (.directory (io/file dir))))
os-is-windows (.startsWith (System/getProperty "os.name") "Windows")
PATH (if os-is-windows "Path" "PATH")
^String path (or
(-> pb .environment (get PATH))
(throw (Exception. (str "No " PATH " variable found in the environment."))))
path (if os-is-windows
(or (-> pb .environment (get "Path")) (-> pb .environment (get "PATH")))
(-> pb .environment (get "PATH")))
bins (if os-is-windows [(str bin ".exe") (str bin ".bat")] [bin])
full-bin
(or
Expand Down Expand Up @@ -339,7 +338,7 @@
entry-point (case bin
"flutter" (java.io.File. libdir "main.dart")
"dart" (java.io.File. "bin" (str project_name ".dart")))
lib (compiler/relativize-lib (.getPath entry-point) (compiler/ns-to-lib main-ns))]
lib (compiler/relativize-lib (str/join "/" (map #(.toString %) (.toPath entry-point))) (compiler/ns-to-lib main-ns))]
(spit entry-point (str "export " (compiler/with-dart-str (compiler/write-string-literal lib)) " show main;\n"))))

(defn init-project [bin-opts]
Expand Down

0 comments on commit 02d9d66

Please sign in to comment.