updated zsh install script
This commit is contained in:
@@ -56,8 +56,8 @@ install_package() {
|
|||||||
if [ -d "$HOME/.oh-my-zsh" ]; then
|
if [ -d "$HOME/.oh-my-zsh" ]; then
|
||||||
printf "${NOTE} Oh My Zsh found. Creating a backup before uninstalling...${RESET}\n"
|
printf "${NOTE} Oh My Zsh found. Creating a backup before uninstalling...${RESET}\n"
|
||||||
# Perform backup using cp -r and create a backup directory with -backup suffix
|
# Perform backup using cp -r and create a backup directory with -backup suffix
|
||||||
mv "$HOME/.oh-my-zsh" "$HOME/.oh-my-zsh-backup"
|
cp -r "$HOME/.oh-my-zsh" "$HOME/.oh-my-zsh-backup" || true
|
||||||
mv "$HOME/.zshrc" "$HOME/.zshrc-backup"
|
mv "$HOME/.zshrc" "$HOME/.zshrc-backup" || true
|
||||||
|
|
||||||
printf "${NOTE} Backup created....${RESET}\n"
|
printf "${NOTE} Backup created....${RESET}\n"
|
||||||
fi
|
fi
|
||||||
@@ -73,10 +73,14 @@ for ZSH in zsh zsh-completions pokemon-colorscripts-git; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
## Install Oh My Zsh, plugins, and set zsh as default shell
|
# Install Oh My Zsh, plugins, and set zsh as default shell
|
||||||
if command -v zsh >/dev/null; then
|
if command -v zsh >/dev/null; then
|
||||||
printf "${NOTE} Installing Oh My Zsh and plugins...\n"
|
printf "${NOTE} Installing Oh My Zsh and plugins...\n"
|
||||||
|
if [ ! -d "$HOME/.oh-my-zsh" ]; then
|
||||||
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended || true
|
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended || true
|
||||||
|
else
|
||||||
|
echo "Directory .oh-my-zsh already exists. Skipping re-installation."
|
||||||
|
fi
|
||||||
# Check if the directories exist before cloning the repositories
|
# Check if the directories exist before cloning the repositories
|
||||||
if [ ! -d "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions" ]; then
|
if [ ! -d "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions" ]; then
|
||||||
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions || true
|
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions || true
|
||||||
|
|||||||
Reference in New Issue
Block a user