Skip to content

Commit 72a3ce1

Browse files
committed
Fix os type for macos non aarch64 when downloading clojure-lsp server.
1 parent 7a9b8c2 commit 72a3ce1

File tree

1 file changed

+8
-3
lines changed
  • src/main/clojure/com/github/clojure_lsp/intellij

1 file changed

+8
-3
lines changed

src/main/clojure/com/github/clojure_lsp/intellij/server.clj

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,15 @@
4444
(defn ^:private os-name []
4545
(let [os-name (string/lower-case (System/getProperty "os.name" "generic"))]
4646
(cond
47-
(string/starts-with? os-name "windows") :windows
48-
(string/starts-with? os-name "mac") :macos
47+
(string/includes? os-name "win") :windows
48+
(string/includes? os-name "mac") :macos
4949
:else :linux)))
5050

51+
(defn ^:private os-arch []
52+
(if (= "aarch64" (System/getProperty "os.arch"))
53+
:aarch64
54+
:amd64))
55+
5156
(def ^:private latest-version-uri
5257
"https://raw.githubusercontent.com/clojure-lsp/clojure-lsp/master/lib/resources/CLOJURE_LSP_RELEASED_VERSION")
5358

@@ -68,7 +73,7 @@
6873
(tasks/set-progress indicator "LSP: Downloading clojure-lsp")
6974
(let [version (string/trim (slurp latest-version-uri))
7075
platform (os-name)
71-
arch (keyword (System/getProperty "os.arch"))
76+
arch (os-arch)
7277
artifact-name (get-in artifacts [platform arch])
7378
uri (format download-artifact-uri version artifact-name)
7479
dest-file download-path

0 commit comments

Comments
 (0)