Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
djblue committed Dec 22, 2024
1 parent 0457f4e commit 0e43618
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions src/portal/runtime/browser.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
[portal.runtime.fs :as fs]
[portal.runtime.json :as json]
[portal.runtime.shell :as shell]))
#?(:cljr (:import [System.Runtime.InteropServices OSPlatform RuntimeInformation])))
#?(:cljr (:import [System.Diagnostics Process]
[System.Runtime.InteropServices OSPlatform RuntimeInformation])))

(defmulti -open (comp :launcher :options))

Expand Down Expand Up @@ -141,11 +142,11 @@
(println "Goto" url "to view portal ui."))
:cljr
(condp identical? (.Platform Environment/OSVersion)
PlatformID/Win32NT (shell/sh "cmd" "/c" "start" url)
PlatformID/Win32Windows (shell/sh "cmd" "/c" "start" url)
PlatformID/Win32NT (prn (Process/Start "explorer" url))
PlatformID/Win32Windows (prn (Process/Start "explorer" url))
PlatformID/Unix (if (RuntimeInformation/IsOSPlatform OSPlatform/OSX)
(shell/sh "open" url)
(shell/sh "xdg-open" url))
(shell/spawn "open" url)
(shell/spawn "xdg-open" url))
(println "Goto" url "to view portal ui.")))))

#?(:clj (defn- random-uuid [] (java.util.UUID/randomUUID)))
Expand Down
2 changes: 1 addition & 1 deletion src/portal/runtime/shell.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
(.on ps "close" resolve))))
:cljr
(future
(let [{:keys [exit err out]} (apply shell/sh bin args)]
(let [{:keys [exit err out] :as x} (apply shell/sh bin args)]
(when-not (zero? exit)
(prn (into [bin] args))
(println err out))))))
Expand Down

0 comments on commit 0e43618

Please sign in to comment.