File tree Expand file tree Collapse file tree 1 file changed +29
-3
lines changed
Expand file tree Collapse file tree 1 file changed +29
-3
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,20 @@ help() {
6565}
6666
6767
68+ get_arch () {
69+ echo $( uname -m | tr ' [:upper:]' ' [:lower:]' )
70+ }
71+
72+ get_platform () {
73+ echo $( uname -s | awk ' {print tolower($0)}' )
74+ }
75+
76+ # Linux -> GNU/Linux
77+ # Android -> Android
78+ get_os () {
79+ echo $( uname -o | awk ' {print tolower($0)}' )
80+ }
81+
6882#
6983# 1. 若用户指定了安装目录,则安装至那里
7084#
@@ -128,7 +142,7 @@ set_install_dir() {
128142
129143
130144install () {
131- arch=" $( uname -m | tr ' [:upper:] ' ' [:lower:] ' ) "
145+ arch=$( get_arch )
132146
133147 case " $arch " in
134148 x86_64) arch=" x64" ;;
@@ -144,10 +158,22 @@ install() {
144158 ;;
145159 esac
146160
147- platform=" $( uname -s | awk ' {print tolower($0)} ' ) "
161+ platform=$( get_platform )
148162
149163 case " $platform " in
150- linux) platform=" linux" ;;
164+ linux)
165+ platform=" linux"
166+ whatos=$( get_os)
167+ if [ " $whatos " = " android" ]; then
168+ if [ " $userOpt_lang " = " zh" ]; then
169+ info " 抱歉, 暂无预编译二进制文件供安卓使用。请自行编译:"
170+ else
171+ info " Sorry, No precompiled binaries for Android! Please compile it on your own:"
172+ fi
173+ info " $ git clone https://gitee.com/RubyMetric/chsrc.git; cd chsrc; make"
174+ exit 1
175+ fi
176+ ;;
151177 darwin) platform=" macos" ;;
152178 bsd|dragonfly)
153179 platform=" bsd"
You can’t perform that action at this time.
0 commit comments