add zoxide dependency check
This commit is contained in:
@@ -6,11 +6,14 @@
|
|||||||
I will work on making this a bit more sane - later.
|
I will work on making this a bit more sane - later.
|
||||||
'
|
'
|
||||||
|
|
||||||
|
REPO="https://github.com/cdanesi/dotfiles.git"
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
isAvailable zsh
|
isAvailable zsh
|
||||||
isAvailable tmux
|
isAvailable tmux
|
||||||
isAvailable nvim
|
isAvailable nvim
|
||||||
isAvailable git
|
isAvailable git
|
||||||
|
isAvailable zoxide
|
||||||
|
|
||||||
# Oh-My-ZSH
|
# Oh-My-ZSH
|
||||||
if [[ -f $HOME/.oh-my-zsh/oh-my-zsh.sh ]]; then
|
if [[ -f $HOME/.oh-my-zsh/oh-my-zsh.sh ]]; then
|
||||||
@@ -24,6 +27,7 @@ function init() {
|
|||||||
echo "you need to have either curl or wget installed. aborting"
|
echo "you need to have either curl or wget installed. aborting"
|
||||||
return -1
|
return -1
|
||||||
fi
|
fi
|
||||||
|
exec zsh
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -31,30 +35,40 @@ function install_plugins() {
|
|||||||
# tmux plugin manager
|
# tmux plugin manager
|
||||||
if [[ -d $HOME/.config/tmux/plugins/tpm ]]; then
|
if [[ -d $HOME/.config/tmux/plugins/tpm ]]; then
|
||||||
echo "updating tmux plugin manager"
|
echo "updating tmux plugin manager"
|
||||||
|
else
|
||||||
|
echo "installing tmux plugin manager"
|
||||||
fi
|
fi
|
||||||
git clone https://github.com/tmux-plugins/tpm $HOME/.config/tmux/plugins/tpm &> /dev/null
|
git clone https://github.com/tmux-plugins/tpm $HOME/.config/tmux/plugins/tpm &> /dev/null
|
||||||
|
|
||||||
# zsh-autosuggestions
|
# zsh-autosuggestions
|
||||||
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
|
||||||
echo "updating zsh-autosuggestions"
|
echo "updating zsh-autosuggestions"
|
||||||
|
else
|
||||||
|
echo "installing zsh-autosuggestions"
|
||||||
fi
|
fi
|
||||||
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions &> /dev/null
|
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions &> /dev/null
|
||||||
|
|
||||||
# zsh-syntax-highlighting
|
# zsh-syntax-highlighting
|
||||||
if [[ -d ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting ]]; then
|
if [[ -d ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting ]]; then
|
||||||
echo "updating zsh-syntax-highlighting"
|
echo "updating zsh-syntax-highlighting"
|
||||||
|
else
|
||||||
|
echo "installing zsh-syntax-highlighting"
|
||||||
fi
|
fi
|
||||||
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting &> /dev/null
|
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting &> /dev/null
|
||||||
|
|
||||||
# fzf-zsh-plugin
|
# fzf-zsh-plugin
|
||||||
if [[ -d ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/fzf-zsh-plugin ]]; then
|
if [[ -d ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/fzf-zsh-plugin ]]; then
|
||||||
echo "updating fzf-zsh-plugin"
|
echo "updating fzf-zsh-plugin"
|
||||||
|
else
|
||||||
|
echo "installing fzf-zsh-plugin"
|
||||||
fi
|
fi
|
||||||
git clone --depth 1 https://github.com/unixorn/fzf-zsh-plugin.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/fzf-zsh-plugin &> /dev/null
|
git clone --depth 1 https://github.com/unixorn/fzf-zsh-plugin.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/fzf-zsh-plugin &> /dev/null
|
||||||
|
|
||||||
# zsh-vi-mode
|
# zsh-vi-mode
|
||||||
if [[ -d ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-vi-mode ]]; then
|
if [[ -d ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-vi-mode ]]; then
|
||||||
echo "updating zsh-vi-mode"
|
echo "updating zsh-vi-mode"
|
||||||
|
else
|
||||||
|
echo "installing zsh-vi-mode"
|
||||||
fi
|
fi
|
||||||
git clone https://github.com/jeffreytse/zsh-vi-mode ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-vi-mode &> /dev/null
|
git clone https://github.com/jeffreytse/zsh-vi-mode ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-vi-mode &> /dev/null
|
||||||
}
|
}
|
||||||
@@ -63,6 +77,8 @@ function install_themes() {
|
|||||||
#powerlevel10k zsh theme
|
#powerlevel10k zsh theme
|
||||||
if [[ -d ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k ]]; then
|
if [[ -d ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k ]]; then
|
||||||
echo "updating powerlevel10k zsh theme"
|
echo "updating powerlevel10k zsh theme"
|
||||||
|
else
|
||||||
|
echo "installing powerlevel10k theme"
|
||||||
fi
|
fi
|
||||||
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k &> /dev/null
|
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k &> /dev/null
|
||||||
}
|
}
|
||||||
@@ -77,3 +93,13 @@ function isAvailable() {
|
|||||||
init
|
init
|
||||||
install_themes
|
install_themes
|
||||||
install_plugins
|
install_plugins
|
||||||
|
|
||||||
|
cat <<EOF
|
||||||
|
|
||||||
|
You should be okay to clone the repo now:
|
||||||
|
|
||||||
|
git clone $REPO
|
||||||
|
|
||||||
|
EOF
|
||||||
|
|
||||||
|
exec zsh
|
||||||
|
|||||||
Reference in New Issue
Block a user