-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
107 lines (93 loc) · 2.72 KB
/
install.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#!/bin/sh
set -e
if [ $# -eq 0 ]; then
echo "ERROR: Need to specify the install repository"
exit 1
fi
owner="igtm"
repo="openapi-yup-generator"
exe_name="openapi-yup-generator"
githubUrl="https://github.com"
version=""
executable_folder="/usr/local/bin" # Eventually, the executable file will be placed here
get_arch() {
# darwin/amd64: Darwin axetroydeMacBook-Air.local 20.5.0 Darwin Kernel Version 20.5.0: Sat May 8 05:10:33 PDT 2021; root:xnu-7195.121.3~9/RELEASE_X86_64 x86_64
# linux/amd64: Linux test-ubuntu1804 5.4.0-42-generic #46~18.04.1-Ubuntu SMP Fri Jul 10 07:21:24 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
a=$(uname -m)
case ${a} in
"x86_64" | "amd64" )
echo "x86_64"
;;
# "i386" | "i486" | "i586")
# echo "386"
# ;;
"aarch64" | "arm64" | "arm")
echo "aarch64"
;;
*)
echo ${NIL}
;;
esac
}
get_os(){
# darwin: Darwin
a=$(uname -s | awk '{print tolower($0)}')
case ${a} in
"darwin")
echo "apple-darwin"
;;
"windows")
echo "pc-windows-msvc"
;;
"linux")
echo "unknown-linux-gnu"
;;
*)
echo ${NIL}
;;
esac