Skip to content

Commit d885c91

Browse files
authored
Merge pull request #90 from TTWShell/enhance/os-check
enhance os check method
2 parents 0aa1ad8 + e5018c0 commit d885c91

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

install.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@ function backup {
2323
echoo ">>> backup finished"
2424
}
2525

26+
result=`python -mplatform`
2627
platform=""
27-
for i in "Centos","Centos" "Ubuntu","Ubuntu" "Darwin","MacOSX"; do
28+
for i in "Centos","Centos" "Ubuntu","Ubuntu" "Debian","Debian" "Darwin","MacOSX"; do
2829
key=${i%,*}; value=${i#*,};
29-
if [ `python -mplatform | grep -ic $key` == 1 ]; then
30+
if [ `grep -ic $key <<< ${result}` == 1 ]; then
3031
platform=$value
3132
echoo ">>> Your os is $platform."
33+
break
3234
fi
3335
done
3436
@@ -39,7 +41,7 @@ case $platform in
3941
Centos)
4042
sudo bash scripts/init-vim-centos.sh
4143
;;
42-
Ubuntu)
44+
Ubuntu|Debian)
4345
sudo bash scripts/init-vim-ubuntu.sh
4446
;;
4547
MacOSX)
@@ -49,7 +51,7 @@ case $platform in
4951
bash fonts/install-fonts.sh
5052
;;
5153
*)
52-
echoo "暂不支持此系统,欲使用此配置,需要先解决依赖安装的问题,欢迎提pr。"
54+
echoo "暂不支持此系统,欲使用此配置,需要先解决依赖安装的问题,欢迎提pr。result: ${result}"
5355
exit 1
5456
;;
5557
esac

0 commit comments

Comments
 (0)