[更新] 修复安装.zsh调用未按照预期进行的问题, 修复vim组建下载路径冲突的问题
This commit is contained in:
parent
9e529dfdc7
commit
f55fbf6677
22
start.sh
22
start.sh
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/bash
|
#!/usr/bin/bash
|
||||||
|
|
||||||
# wget -qO- https://gitea.whlug.cn/xunmi/getLinux/raw/start.sh | bash
|
# wget -qO- https://gitea.whlug.cn/xunmi/getLinux/raw/start.sh | bash
|
||||||
PACK_LIST=("wget" "git" "zsh")
|
PACK_LIST=("git" "zsh")
|
||||||
# 脚本根地址
|
# 脚本根地址
|
||||||
ROOT_URL="https://gitea.whlug.cn/xunmi/x/"
|
ROOT_URL="https://gitea.whlug.cn/xunmi/x/"
|
||||||
# 插件和依赖安装的路径
|
# 插件和依赖安装的路径
|
||||||
|
@ -64,15 +64,15 @@ Update_Package_Resource() {
|
||||||
Show 0 "包管理器更新完毕"
|
Show 0 "包管理器更新完毕"
|
||||||
}
|
}
|
||||||
|
|
||||||
# 安装Zsh
|
# 安装依赖
|
||||||
Install_Zsh() {
|
Install_PKG() {
|
||||||
Update_Package_Resource
|
Update_Package_Resource
|
||||||
for ((i = 0; i < ${#PACK_LIST[@]}; i++)); do
|
for ((i = 0; i < ${#PACK_LIST[@]}; i++)); do
|
||||||
pack=${PACK_LIST[i]}
|
pack=${PACK_LIST[i]}
|
||||||
Show 2 "安装必要的依赖项: ${aCOLOUR[4]} $pack $COLOUR_RESET"
|
Show 2 "安装必要的依赖项: ${aCOLOUR[4]} $pack $COLOUR_RESET"
|
||||||
GreyStart
|
GreyStart
|
||||||
if [ -x "$(command -v oma)" ]; then
|
if [ -x "$(command -v oma)" ]; then
|
||||||
sudo oma -y install $pack
|
sudo oma install -y $pack
|
||||||
elif [ -x "$(command -v apt)" ]; then
|
elif [ -x "$(command -v apt)" ]; then
|
||||||
sudo apt -y install $pack
|
sudo apt -y install $pack
|
||||||
elif [ -x "$(command -v yum)" ]; then
|
elif [ -x "$(command -v yum)" ]; then
|
||||||
|
@ -121,17 +121,21 @@ Download_X(){
|
||||||
}
|
}
|
||||||
|
|
||||||
#################################################################
|
#################################################################
|
||||||
# 主函数(main) #
|
# 主函数(main) #
|
||||||
#################################################################
|
#################################################################
|
||||||
|
|
||||||
Install_Zsh
|
([ -x "$(command -v git)" ] && [ -x "$(command -v zsh)" ]) || Install_PKG
|
||||||
# 如果携带 -c 则不下载安装ohmyzsh
|
# 如果携带 -c 则不下载安装ohmyzsh
|
||||||
[[ "$@" == *-c* ]] || Download_Config
|
[[ "$@" == *-c* ]] || Download_Config
|
||||||
# 如果携带 -x 则不下载安装言灵
|
# 如果携带 -x 则不下载安装言灵
|
||||||
[[ "$@" == *-x* ]] || Download_X
|
[[ "$@" == *-x* ]] || Download_X
|
||||||
sudo chown -R $USER:$USER $x_dir
|
sudo chown -R $USER:$USER $x_dir
|
||||||
(( $X_START == 1 )) && zsh $x_dir/安装.zsh
|
|
||||||
exec zsh
|
|
||||||
# 写入配置文件
|
# 写入配置文件
|
||||||
mkdir -p $HOME/.config/xunmi
|
mkdir -p $HOME/.config/xunmi
|
||||||
echo "寻觅=$ROOT_INSTALL" > $HOME/.config/xunmi/PATH.sh
|
echo "寻觅=${ROOT_INSTALL}" > $HOME/.config/xunmi/PATH.sh
|
||||||
|
if [ -f "安装.zsh" ]; then
|
||||||
|
zsh 安装.zsh
|
||||||
|
else
|
||||||
|
(( $X_START == 1 )) && zsh $x_dir/安装.zsh
|
||||||
|
fi
|
||||||
|
exec zsh
|
||||||
|
|
|
@ -30,8 +30,9 @@
|
||||||
|
|
||||||
# 调用当前包管理器的安装模块
|
# 调用当前包管理器的安装模块
|
||||||
包管_安装(){
|
包管_安装(){
|
||||||
|
[ -x "$(command -v $1)" ] && return 0
|
||||||
if [ -x "$(command -v oma)" ]; then
|
if [ -x "$(command -v oma)" ]; then
|
||||||
sudo oma -y install $1
|
sudo oma install -y $1
|
||||||
elif [ -x "$(command -v apt)" ]; then
|
elif [ -x "$(command -v apt)" ]; then
|
||||||
sudo apt -y install $1
|
sudo apt -y install $1
|
||||||
elif [ -x "$(command -v yum)" ]; then
|
elif [ -x "$(command -v yum)" ]; then
|
||||||
|
|
4
安装.zsh
4
安装.zsh
|
@ -97,9 +97,9 @@ readonly 系统_发行版_名称=$(echo "${NAME}")
|
||||||
rm -vrf ${vim_配置路径}
|
rm -vrf ${vim_配置路径}
|
||||||
mkdir -vp ${vim_配置路径}/{opt,start}
|
mkdir -vp ${vim_配置路径}/{opt,start}
|
||||||
# 树状目录
|
# 树状目录
|
||||||
git clone --depth 1 https://gitcode.com/mirrors/scrooloose/nerdtree.git ${vim_配置路径}/start
|
git clone --depth 1 https://gitcode.com/mirrors/scrooloose/nerdtree.git ${vim_配置路径}/start/树状目录
|
||||||
# 代码检查工具
|
# 代码检查工具
|
||||||
git clone --depth 1 https://gitcode.com/mirrors/dense-analysis/ale.git ${vim_配置路径}/start
|
git clone --depth 1 https://gitcode.com/mirrors/dense-analysis/ale.git ${vim_配置路径}/start/代码检查工具
|
||||||
cp -v 配置/vimrc $HOME/.vimrc
|
cp -v 配置/vimrc $HOME/.vimrc
|
||||||
色彩_清除
|
色彩_清除
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user