优化Zsh安装脚本执行逻辑
- 移除oh-my-zsh插件列表文件的清理步骤 - 将Zsh安装命令从"/bin/bash"改为"sh -c" - 针对国内网络环境,使用SingleLineCommandExecutor设置远程仓库地址 - 简化Zsh插件安装命令的执行方式
This commit is contained in:
@@ -38,7 +38,6 @@ func addZshSubcommands(cmd *cobra.Command) {
|
||||
// 清理残留
|
||||
utils.RemoveFolderComplete("/root/.oh-my-zsh")
|
||||
utils.RemoveFolderComplete("/root/wdd/zsh-install.sh")
|
||||
utils.RemoveFolderComplete("/root/wdd/oh-my-zsh-plugins-list.txt")
|
||||
|
||||
ohMyZshInstallUrl := ""
|
||||
|
||||
@@ -61,14 +60,16 @@ func addZshSubcommands(cmd *cobra.Command) {
|
||||
})
|
||||
|
||||
installZshCommand := []string{
|
||||
"/bin/bash",
|
||||
"sh",
|
||||
"-c",
|
||||
"/root/wdd/zsh-install.sh",
|
||||
}
|
||||
|
||||
if config.ConfigCache.Agent.Network.Internet == 7 {
|
||||
installZshCommand = append(installZshCommand,
|
||||
op.SingleLineCommandExecutor([]string{
|
||||
"export",
|
||||
"REMOTE=https://gitea.107421.xyz/zeaslity/ohmyzsh.git",
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
// 执行 oh-my-zsh 安装命令
|
||||
|
||||
Reference in New Issue
Block a user