forked from fishros/install
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall
More file actions
43 lines (38 loc) · 994 Bytes
/
Copy pathinstall
File metadata and controls
43 lines (38 loc) · 994 Bytes
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
export FISHROS_URL=http://mirror.fishros.com/install/
mkdir -p /tmp/fishinstall/tools/translation/assets
wget $FISHROS_URL/install.py -O /tmp/fishinstall/install.py 2>>/dev/null
source /etc/profile
SUDO=''
if [ $UID -ne 0 ];then
SUDO='sudo'
fi
$SUDO apt install python3-distro python3-yaml -y
$SUDO python3 /tmp/fishinstall/install.py
$SUDO rm -rf /tmp/fishinstall/
if [ -f fishros ]; then
$SUDO rm fishros
fi
# 初始假设默认是 Bash
shell_name='bash'
if shopt -u lastpipe 2> /dev/null; then
# 当前 shell 是 Bash
:
else
# 当前 shell 是 Zsh 或其他 shell
if test -n "$ZSH_VERSION"; then
shell_name='zsh'
else
# 当前使用的 shell 不是 Bash 或 Zsh
shell_name=''
fi
fi
# 根据 shell 名称加载相应的配置文件
if [ "$shell_name" = "bash" ]; then
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
elif [ "$shell_name" = "zsh" ]; then
if [ -f ~/.zshrc ]; then
source ~/.zshrc
fi
fi