Przeglądaj źródła

Merge pull request #24 from dkinzer/update-configlet-script

Fetch appropriate configlet binary
Katrina Owen 11 lat temu
rodzic
commit
c291fce744
1 zmienionych plików z 25 dodań i 1 usunięć
  1. 25
    1
      bin/fetch-configlet

+ 25
- 1
bin/fetch-configlet Wyświetl plik

@@ -2,7 +2,31 @@
2 2
 
3 3
 LATEST=https://github.com/exercism/configlet/releases/latest
4 4
 
5
+OS=$(
6
+case $(uname) in
7
+    Darwin*)
8
+        echo "mac";;
9
+    Linux*)
10
+        echo "linux";;
11
+    Windows*)
12
+        echo "windows";;
13
+    *)
14
+        echo "linux";;
15
+esac)
16
+
17
+ARCH=$(
18
+case $(uname -m) in
19
+    *64*)
20
+        echo 64bit;;
21
+    *686*)
22
+        echo 32bit;;
23
+    *386*)
24
+        echo 32bit;;
25
+    *)
26
+        echo 64bit;;
27
+esac)
28
+
5 29
 VERSION="$(curl --head --silent $LATEST | awk -v FS=/ '/Location:/{print $NF}' | tr -d '\r')"
6
-URL=https://github.com/exercism/configlet/releases/download/$VERSION/configlet-linux-64bit.tgz
30
+URL=https://github.com/exercism/configlet/releases/download/$VERSION/configlet-$OS-${ARCH}.tgz
7 31
 
8 32
 curl -s --location $URL | tar xz -C bin/