From 02d9d6670ca2e8b19cc34f47348d9b6fb228e309 Mon Sep 17 00:00:00 2001 From: Steve Johnson Date: Thu, 12 Dec 2024 05:55:35 -0700 Subject: [PATCH] get cljd.build working on windows from powershell and cmd (#331) --- clj/src/cljd/build.clj | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/clj/src/cljd/build.clj b/clj/src/cljd/build.clj index dd4c866d..431f538b 100644 --- a/clj/src/cljd/build.clj +++ b/clj/src/cljd/build.clj @@ -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 @@ -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]