83 lines
2.3 KiB
Bash
Executable File
83 lines
2.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
if ! command -v diff-so-fancy &> /dev/null; then
|
|
echo "installing diff-so-fancy"
|
|
git clone https://github.com/so-fancy/diff-so-fancy ~/local/src/diffsofancy
|
|
chmod +x ~/local/src/diffsofancy/diff-so-fancy
|
|
ln -s ~/local/src/diffsofancy/diff-so-fancy ~/local/bin/
|
|
else
|
|
echo "upgrading diff-so-fancy"
|
|
cd ~/local/src/diffsofancy
|
|
git pull
|
|
chmod +x ~/local/src/diffsofancy/diff-so-fancy
|
|
ln -f -s ~/local/src/diffsofancy/diff-so-fancy ~/local/bin/
|
|
cd - > /dev/null
|
|
fi
|
|
|
|
if ! command -v vim &> /dev/null; then
|
|
echo "warning: vim not found"
|
|
echo "please install from your package manager and try again"
|
|
else
|
|
if ! test -e ~/.vim/bundle/Vundle.vim; then
|
|
echo "installing vundle"
|
|
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
|
|
echo "installing vim plugins"
|
|
vim +PluginInstall +qall
|
|
else
|
|
echo "upgrading vim plugins"
|
|
vim +PluginUpdate +qall
|
|
echo "upgrading vundle"
|
|
cd ~/.vim/bundle/Vundle.vim
|
|
git pull
|
|
cd - > /dev/null
|
|
fi
|
|
fi
|
|
|
|
if ! command -v tmux &> /dev/null; then
|
|
echo "warning: tmux not found"
|
|
echo "https://github.com/tmux/tmux/wiki"
|
|
else
|
|
if ! test -e ~/.tmux/plugins/tpm; then
|
|
echo "installing tmux package manager"
|
|
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
|
|
tmux source ~/.tmux.conf
|
|
echo "remember to hit <prefix> + I to install tmux plugins"
|
|
else
|
|
echo "upgrading tpm"
|
|
cd ~/.tmux/plugins/tpm
|
|
# git fetch origin
|
|
# FIXME: don't hard code master and origin
|
|
# reslog=$(git log HEAD..origin/master --oneline)
|
|
# if [[ "${reslog}" != "" ]] ; then
|
|
# git merge origin/master # completing the pull
|
|
# tmux source ~/.tmux.conf
|
|
# cd - > /dev/null
|
|
# fi
|
|
git pull
|
|
tmux source ~/.tmux.conf
|
|
cd - > /dev/null
|
|
fi
|
|
fi
|
|
|
|
if ! command -v tig &> /dev/null; then
|
|
echo "installing tig"
|
|
mkdir -p ~/local/src ~/local/bin
|
|
prevpwd=$PWD
|
|
cd ~/local/src
|
|
git clone https://github.com/jonas/tig
|
|
cd tig
|
|
make prefix=~/local
|
|
make install prefix=~/local
|
|
cd $prevpwd
|
|
fi
|
|
# TODO: Also upgrade tig
|
|
|
|
cat <<END
|
|
|
|
Kitty (optional)
|
|
- Set up fonts.conf, see mac-fonts.conf for an example
|
|
|
|
END
|
|
|
|
echo "done!"
|