[修复] 修复选装逻辑判断反了的问题, 优化zshrc模板增强通用性
This commit is contained in:
parent
92c378b4c5
commit
f673c93b6a
15
start.sh
15
start.sh
|
@ -59,9 +59,9 @@ Select_Continue() {
|
||||||
Show 0 "$1((是/否 Yes/No))"
|
Show 0 "$1((是/否 Yes/No))"
|
||||||
read r
|
read r
|
||||||
if echo "$r" | grep -Eq "^[是Yy][Ee]?[Ss]?$";then
|
if echo "$r" | grep -Eq "^[是Yy][Ee]?[Ss]?$";then
|
||||||
return 1
|
|
||||||
else
|
|
||||||
return 0
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,19 +104,18 @@ Install_Zsh() {
|
||||||
# 下载配置
|
# 下载配置
|
||||||
Download_Config() {
|
Download_Config() {
|
||||||
# 创建下载文件的临时目录
|
# 创建下载文件的临时目录
|
||||||
GreyStart
|
|
||||||
Show 0 "正在进行插件下载与配置"
|
Show 0 "正在进行插件下载与配置"
|
||||||
|
|
||||||
# 下载zsh扩展
|
# 下载zsh扩展
|
||||||
|
GreyStart
|
||||||
ohmyzsh_dir=${ROOT_INSTALL}/oh-my-zsh
|
ohmyzsh_dir=${ROOT_INSTALL}/oh-my-zsh
|
||||||
sudo git clone https://gitcode.com/mirrors/ohmyzsh/ohmyzsh.git ${ohmyzsh_dir}
|
sudo git clone https://gitcode.com/mirrors/ohmyzsh/ohmyzsh.git ${ohmyzsh_dir} || Show 1 "关键依赖下载失败"
|
||||||
cd ${ohmyzsh_dir}/custom/plugins/
|
cd ${ohmyzsh_dir}/custom/plugins/
|
||||||
sudo git clone https://gitcode.com/mirrors/zsh-users/zsh-autosuggestions.git
|
sudo git clone https://gitcode.com/mirrors/zsh-users/zsh-autosuggestions.git
|
||||||
sudo git clone https://gitcode.com/mirrors/zsh-users/zsh-syntax-highlighting.git
|
sudo git clone https://gitcode.com/mirrors/zsh-users/zsh-syntax-highlighting.git
|
||||||
# 下载预设配置
|
# 下载预设配置
|
||||||
config_url=${ROOT_URL}/raw/配置/zshrc
|
config_url=${ROOT_URL}/raw/配置/zshrc
|
||||||
sudo wget -t 3 -q --show-progress -c "${config_url}" || Show 1 "无法下载预设配置(${config_url})"
|
sudo wget -t 3 -q --show-progress -c "${config_url}" || Show 1 "无法下载预设配置(${config_url})"
|
||||||
sed -i "s/export ZSH=\/etc\/oh-my-zsh/export ZSH=$ohmyzsh_dir/" zshrc
|
sudo sed -i "s:export ZSH=/etc/oh-my-zsh:export ZSH=$ohmyzsh_dir:" zshrc
|
||||||
sudo mv zshrc /etc/skel/.zshrc
|
sudo mv zshrc /etc/skel/.zshrc
|
||||||
cp -v /etc/skel/.zshrc $HOME
|
cp -v /etc/skel/.zshrc $HOME
|
||||||
ColorReset
|
ColorReset
|
||||||
|
@ -126,11 +125,11 @@ Download_Config() {
|
||||||
# 选配
|
# 选配
|
||||||
Select_Config(){
|
Select_Config(){
|
||||||
if Select_Continue "启动zsh"; then
|
if Select_Continue "启动zsh"; then
|
||||||
zsh
|
exec zsh
|
||||||
Show 2 "zsh启动完成"
|
Show 2 "zsh启动完成"
|
||||||
fi
|
fi
|
||||||
if Select_Continue "将Zsh设置为默认命令行"; then
|
if Select_Continue "将Zsh设置为默认命令行"; then
|
||||||
sudo chsh -s /usr/bin/zsh
|
chsh -s /usr/bin/zsh
|
||||||
Show 2 "已将zsh设置为默认命令行"
|
Show 2 "已将zsh设置为默认命令行"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user