mirror of
https://github.com/correl/elm.git
synced 2025-03-06 20:25:18 -10:00
Detect OS for Elm Format Download
This commit is contained in:
parent
ecb6e88d14
commit
359ad21a08
1 changed files with 14 additions and 18 deletions
|
@ -1,23 +1,19 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# choose file for system
|
||||
# Example:
|
||||
# bin/install-elm-format linux
|
||||
# bin/install-elm-format mac
|
||||
case $1 in
|
||||
mac)
|
||||
FILE=https://github.com/avh4/elm-format/releases/download/0.4.0-alpha/elm-format-0.17-0.4.0-alpha-mac-x64.tgz
|
||||
;;
|
||||
linux)
|
||||
FILE=https://github.com/avh4/elm-format/releases/download/0.4.0-alpha/elm-format-0.17-0.4.0-alpha-linux-x64.tgz
|
||||
;;
|
||||
*)
|
||||
echo "please specify operating system"
|
||||
exit 1
|
||||
esac
|
||||
OS=$(
|
||||
case $(uname) in
|
||||
(Darwin*)
|
||||
echo "mac";;
|
||||
(Linux*)
|
||||
echo "linux";;
|
||||
(Windows*)
|
||||
echo "windows";;
|
||||
(*)
|
||||
echo "linux";;
|
||||
esac)
|
||||
|
||||
# download file into bin
|
||||
curl -L $FILE | tar -xvzO > bin/elm-format
|
||||
URL=https://github.com/avh4/elm-format/releases/download/0.4.0-alpha/elm-format-0.17-0.4.0-alpha-$OS-x64.tgz
|
||||
|
||||
curl -L $URL | tar -xvzO > bin/elm-format
|
||||
|
||||
# give user execute
|
||||
chmod u+x bin/elm-format
|
||||
|
|
Loading…
Add table
Reference in a new issue