-
Notifications
You must be signed in to change notification settings - Fork 6
/
get-cli.sh
executable file
·39 lines (37 loc) · 1.29 KB
/
get-cli.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
option="${1:-all}"
cli_version=${2:-latest}
case ${option} in
linux)
echo "Downloading linux binary version: ${cli_version}"
curl -L https://github.com/openhie/instant-v2/releases/download/"$cli_version"/instant-linux -o instant-linux
chmod +x ./instant-linux
exit 0
;;
macos)
echo "Downloading macos binary version: ${cli_version}"
curl -L https://github.com/openhie/instant-v2/releases/download/"$cli_version"/instant-macos -o instant-macos
chmod +x ./instant-macos
exit 0
;;
windows)
echo "Downloading windows binary version: ${cli_version}"
curl -L https://github.com/openhie/instant-v2/releases/download/"$cli_version"/instant-win.exe -o instant.exe
chmod +x ./instant.exe
exit 0
;;
all)
echo "Downloading all binaries, version: ${cli_version}"
curl -L https://github.com/openhie/instant-v2/releases/download/"$cli_version"/instant-linux -o instant-linux
curl -L https://github.com/openhie/instant-v2/releases/download/"$cli_version"/instant-macos -o instant-macos
curl -L https://github.com/openhie/instant-v2/releases/download/"$cli_version"/instant-win.exe -o instant.exe
chmod +x ./instant-linux
chmod +x ./instant-macos
chmod +x ./instant.exe
exit 0
;;
--help)
echo "Usage: get-cli.sh [linux|macos|windows|all] {cli_version}"
exit 0
;;
esac