Only checking for commands that are USED by the installer and not the ones utilized within the dotfiles themselves. Since fzf has a sourced file in the zshrc, it'll bark if that's missing already.
60 lines
1.1 KiB
Bash
Executable file
60 lines
1.1 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
if [ -z "$HOME" ]; then
|
|
echo "Seems you're \$HOMEless :("; exit 1;
|
|
fi
|
|
|
|
COMMANDS="curl git stow"
|
|
|
|
for COMMAND in $COMMANDS; do
|
|
if ! command -v "$COMMAND" &> /dev/null; then
|
|
echo "Please install $COMMAND";
|
|
exit 1;
|
|
fi
|
|
done
|
|
|
|
DOTFILES=$HOME/.dotfiles
|
|
DOTLOCAL=$HOME/.local/share/dotfiles
|
|
|
|
GITCLONE="git clone --depth=1"
|
|
|
|
if [ ! -d "$DOTFILES" ]; then
|
|
git clone git@github.com:joshtronic/dotfiles.git "$DOTFILES"
|
|
cd "$DOTFILES" || exit
|
|
else
|
|
cd "$DOTFILES" || exit
|
|
git pull origin main
|
|
fi
|
|
|
|
rm -rf "$DOTLOCAL"
|
|
mkdir -p "$DOTLOCAL"
|
|
|
|
stow git screen vim zsh
|
|
|
|
VIMPLUGS=(
|
|
# File exploration and navigation
|
|
"junegunn/fzf.vim"
|
|
|
|
# Languages and syntax
|
|
"sheerun/vim-polyglot"
|
|
|
|
# Style guide and linting
|
|
"dense-analysis/ale"
|
|
"editorconfig/editorconfig-vim"
|
|
|
|
# TypeScript
|
|
"leafgarland/typescript-vim"
|
|
"Quramy/tsuquyomi"
|
|
)
|
|
|
|
for INDEX in ${!VIMPLUGS[*]}; do
|
|
VIMPLUG="${VIMPLUGS[$INDEX]}"
|
|
PLUGDIR=$(echo "$VIMPLUG" | cut -d '/' -f2)
|
|
$GITCLONE "https://github.com/$VIMPLUG.git" "$HOME/.vim/pack/plugins/start/$PLUGDIR"
|
|
done
|
|
|
|
cd "$HOME" || exit
|
|
rm -f "${HOME}/.zcompdump*"
|
|
|
|
echo
|
|
echo "ENJOY! :)"
|