-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathinstall.sh
More file actions
53 lines (51 loc) · 2.03 KB
/
install.sh
File metadata and controls
53 lines (51 loc) · 2.03 KB
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
#!/bin/sh
ARCH=$(uname -m)
OS_TYPE=$OSTYPE
if [[ "$OS_TYPE" == "linux-gnu"* ]]; then
echo "需要sudo授权"
sudo echo "授权成功"
if [ "$ARCH" == "x86_64" ]; then
echo "开始下载"
sudo curl -ssL https://isxcode.oss-cn-shanghai.aliyuncs.com/zhixingyun/isx_linux_amd64 -o /usr/bin/isx_linux_amd64
echo "下载完成"
sudo mv /usr/bin/isx_linux_amd64 /usr/bin/isx
sudo chmod a+x /usr/bin/isx
echo "安装成功"
fi
elif [[ "$OS_TYPE" == "darwin"* ]]; then
echo "需要sudo授权"
sudo echo "授权成功"
if [ "$ARCH" == "x86_64" ]; then
echo "开始下载"
sudo curl -ssL https://isxcode.oss-cn-shanghai.aliyuncs.com/zhixingyun/isx_darwin_amd64 -o /usr/local/bin/isx_darwin_amd64
echo "下载完成"
sudo mv /usr/local/bin/isx_darwin_amd64 /usr/local/bin/isx
sudo chmod a+x /usr/local/bin/isx
echo "安装成功"
elif [ "$ARCH" == "arm64" ]; then
echo "开始下载"
sudo curl -ssL https://isxcode.oss-cn-shanghai.aliyuncs.com/zhixingyun/isx_darwin_arm64 -o /usr/local/bin/isx_darwin_arm64
echo "下载完成"
sudo mv /usr/local/bin/isx_darwin_arm64 /usr/local/bin/isx
sudo chmod a+x /usr/local/bin/isx
echo "安装成功"
fi
else
if [ "$ARCH" == "x86_64" ]; then
echo "开始下载"
curl -ssL https://isxcode.oss-cn-shanghai.aliyuncs.com/zhixingyun/isx_windows_amd64.exe -o /usr/bin/isx_windows_amd64.exe
echo "下载完成"
rm -rf /usr/bin/isx.exe
mv /usr/bin/isx_windows_amd64.exe /usr/bin/isx.exe
chmod a+x /usr/bin/isx.exe
echo "安装成功"
elif [ "$ARCH" == "arm64" ]; then
echo "开始下载"
curl -ssL https://isxcode.oss-cn-shanghai.aliyuncs.com/zhixingyun/isx_windows_arm64.exe -o /usr/bin/isx_windows_arm64.exe
echo "下载完成"
rm -rf /usr/bin/isx.exe
mv /usr/bin/isx_windows_arm64.exe /usr/bin/isx.exe
chmod a+x /usr/bin/isx.exe
echo "安装成功"
fi
fi