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

Run CLR tests on Windows #255

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
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
2 changes: 1 addition & 1 deletion .github/workflows/clojure.yml
Original file line number Diff line number Diff line change
@@ -75,7 +75,7 @@ jobs:
needs: [ setup, build ]
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
11 changes: 6 additions & 5 deletions src/portal/runtime/browser.cljc
Original file line number Diff line number Diff line change
@@ -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))

@@ -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)))
2 changes: 1 addition & 1 deletion src/portal/runtime/shell.cljc
Original file line number Diff line number Diff line change
@@ -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))))))