update check functions
This commit is contained in:
@@ -4,20 +4,20 @@ function install_plugins() {
|
||||
return
|
||||
fi
|
||||
|
||||
if [ ! -n "${ZSH_PLUGINS_PATH}" ]; then
|
||||
echo "ZSH_PLUGINS_PATH is not set. Please set it and try again."
|
||||
if [ ! -n "${ZSH_POLYJUICE_PLUGINS_PATH}" ]; then
|
||||
echo "ZSH_POLYJUICE_PLUGINS_PATH is not set. Please set it and try again."
|
||||
return
|
||||
fi
|
||||
|
||||
# git clone zsh-autosuggestions
|
||||
if [ ! -d "$ZSH_PLUGINS_PATH"/zsh-autosuggestions ]; then
|
||||
if [ ! -d "$ZSH_POLYJUICE_PLUGINS_PATH"/zsh-autosuggestions ]; then
|
||||
echo "Zsh Autosuggestions is not downloaded. Downloading..."
|
||||
# git clone https://github.com/zsh-users/zsh-autosuggestions.git "$ZSH_PLUGINS_PATH"/zsh-autosuggestions
|
||||
git clone https://gitee.com/mirrors/zsh-autosuggestions.git "$ZSH_PLUGINS_PATH"/zsh-autosuggestions
|
||||
# git clone https://github.com/zsh-users/zsh-autosuggestions.git "$ZSH_POLYJUICE_PLUGINS_PATH"/zsh-autosuggestions
|
||||
git clone https://gitee.com/mirrors/zsh-autosuggestions.git "$ZSH_POLYJUICE_PLUGINS_PATH"/zsh-autosuggestions
|
||||
else
|
||||
cd "$ZSH_PLUGINS_PATH"/zsh-autosuggestions
|
||||
cd "$ZSH_POLYJUICE_PLUGINS_PATH"/zsh-autosuggestions
|
||||
if [ ! -d .git ]; then
|
||||
echo "Zsh Autosuggestions is not a git repository. Please remove $ZSH_PLUGINS_PATH/zsh-autosuggestions and try again."
|
||||
echo "Zsh Autosuggestions is not a git repository. Please remove $ZSH_POLYJUICE_PLUGINS_PATH/zsh-autosuggestions and try again."
|
||||
else
|
||||
echo "Zsh Autosuggestions is already exist. Updating..."
|
||||
git pull
|
||||
@@ -26,14 +26,14 @@ function install_plugins() {
|
||||
fi
|
||||
|
||||
# git clone zsh-syntax-highlighting
|
||||
if [ ! -d "$ZSH_PLUGINS_PATH"/zsh-syntax-highlighting ]; then
|
||||
if [ ! -d "$ZSH_POLYJUICE_PLUGINS_PATH"/zsh-syntax-highlighting ]; then
|
||||
echo "Zsh Syntax Highlighting is not downloaded. Downloading..."
|
||||
# git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "$ZSH_PLUGINS_PATH"/zsh-syntax-highlighting
|
||||
git clone https://gitee.com/mirrors/zsh-syntax-highlighting.git "$ZSH_PLUGINS_PATH"/zsh-syntax-highlighting
|
||||
# git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "$ZSH_POLYJUICE_PLUGINS_PATH"/zsh-syntax-highlighting
|
||||
git clone https://gitee.com/mirrors/zsh-syntax-highlighting.git "$ZSH_POLYJUICE_PLUGINS_PATH"/zsh-syntax-highlighting
|
||||
else
|
||||
cd "$ZSH_PLUGINS_PATH"/zsh-syntax-highlighting
|
||||
cd "$ZSH_POLYJUICE_PLUGINS_PATH"/zsh-syntax-highlighting
|
||||
if [ ! -d .git ]; then
|
||||
echo "Zsh Syntax Highlighting is not a git repository. Please remove $ZSH_PLUGINS_PATH/zsh-syntax-highlighting and try again."
|
||||
echo "Zsh Syntax Highlighting is not a git repository. Please remove $ZSH_POLYJUICE_PLUGINS_PATH/zsh-syntax-highlighting and try again."
|
||||
else
|
||||
echo "Zsh Syntax Highlighting is already exist. Updating..."
|
||||
git pull
|
||||
@@ -42,14 +42,14 @@ function install_plugins() {
|
||||
fi
|
||||
|
||||
# git clone zsh-autocomplete
|
||||
if [ ! -d "$ZSH_PLUGINS_PATH"/zsh-autocomplete ]; then
|
||||
if [ ! -d "$ZSH_POLYJUICE_PLUGINS_PATH"/zsh-autocomplete ]; then
|
||||
echo "Zsh Autocomplete is not downloaded. Downloading..."
|
||||
# git clone https://github.com/marlonrichert/zsh-autocomplete.git "$ZSH_PLUGINS_PATH"/zsh-autocomplete
|
||||
git clone https://gitee.com/mirrors/zsh-autocomplete.git "$ZSH_PLUGINS_PATH"/zsh-autocomplete
|
||||
# git clone https://github.com/marlonrichert/zsh-autocomplete.git "$ZSH_POLYJUICE_PLUGINS_PATH"/zsh-autocomplete
|
||||
git clone https://gitee.com/mirrors/zsh-autocomplete.git "$ZSH_POLYJUICE_PLUGINS_PATH"/zsh-autocomplete
|
||||
else
|
||||
cd "$ZSH_PLUGINS_PATH"/zsh-autocomplete
|
||||
cd "$ZSH_POLYJUICE_PLUGINS_PATH"/zsh-autocomplete
|
||||
if [ ! -d .git ]; then
|
||||
echo "Zsh Autocomplete is not a git repository. Please remove $ZSH_PLUGINS_PATH/zsh-autocomplete and try again."
|
||||
echo "Zsh Autocomplete is not a git repository. Please remove $ZSH_POLYJUICE_PLUGINS_PATH/zsh-autocomplete and try again."
|
||||
else
|
||||
echo "Zsh Autocomplete is already exist. Updating..."
|
||||
git pull
|
||||
@@ -58,13 +58,13 @@ function install_plugins() {
|
||||
fi
|
||||
|
||||
# git clone fzf-tab
|
||||
if [ ! -d "$ZSH_PLUGINS_PATH"/fzf-tab ]; then
|
||||
if [ ! -d "$ZSH_POLYJUICE_PLUGINS_PATH"/fzf-tab ]; then
|
||||
echo "fzf-tab is not downloaded. Downloading..."
|
||||
git clone https://github.com/Aloxaf/fzf-tab.git "$ZSH_PLUGINS_PATH"/fzf-tab
|
||||
git clone https://github.com/Aloxaf/fzf-tab.git "$ZSH_POLYJUICE_PLUGINS_PATH"/fzf-tab
|
||||
else
|
||||
cd "$ZSH_PLUGINS_PATH"/fzf-tab
|
||||
cd "$ZSH_POLYJUICE_PLUGINS_PATH"/fzf-tab
|
||||
if [ ! -d .git ]; then
|
||||
echo "fzf-tab is not a git repository. Please remove $ZSH_PLUGINS_PATH/fzf-tab and try again."
|
||||
echo "fzf-tab is not a git repository. Please remove $ZSH_POLYJUICE_PLUGINS_PATH/fzf-tab and try again."
|
||||
else
|
||||
echo "fzf-tab is already exist. Updating..."
|
||||
git pull
|
||||
@@ -73,14 +73,14 @@ function install_plugins() {
|
||||
fi
|
||||
|
||||
# git clone oh-my-zsh
|
||||
if [ ! -d "$ZSH_PLUGINS_PATH"/ohmyzsh ]; then
|
||||
if [ ! -d "$ZSH_POLYJUICE_PLUGINS_PATH"/ohmyzsh ]; then
|
||||
echo "Oh My Zsh is not downloaded. Downloading..."
|
||||
# git clone https://github.com/ohmyzsh/ohmyzsh.git "$PATH_OHMYZSH"
|
||||
git clone https://gitee.com/mirrors/ohmyzsh.git "$ZSH_PLUGINS_PATH"/ohmyzsh
|
||||
git clone https://gitee.com/mirrors/ohmyzsh.git "$ZSH_POLYJUICE_PLUGINS_PATH"/ohmyzsh
|
||||
else
|
||||
cd "$ZSH_PLUGINS_PATH"/ohmyzsh
|
||||
cd "$ZSH_POLYJUICE_PLUGINS_PATH"/ohmyzsh
|
||||
if [ ! -d .git ]; then
|
||||
echo "Oh My Zsh is not a git repository. Please remove $ZSH_PLUGINS_PATH/ohmyzsh and try again."
|
||||
echo "Oh My Zsh is not a git repository. Please remove $ZSH_POLYJUICE_PLUGINS_PATH/ohmyzsh and try again."
|
||||
else
|
||||
echo "Oh My Zsh is already exist. Updating..."
|
||||
git pull
|
||||
|
||||
Reference in New Issue
Block a user