dotfiles/install.sh

54 lines
1.6 KiB
Bash
Raw Permalink Normal View History

2019-03-25 09:28:39 +00:00
#!/bin/bash
2019-03-25 12:58:16 +00:00
2019-05-13 18:28:35 +00:00
echo "==> running dotfiles install script"
2019-03-25 12:58:16 +00:00
BASE=$HOME/.dotfiles
2019-03-25 13:04:20 +00:00
if [ ! -d "$BASE" ]; then
2019-05-13 18:28:35 +00:00
echo "==> cloning git repository"
2019-05-13 17:44:04 +00:00
git clone git@github.com:sundowndev/dotfiles.git $BASE
2019-03-25 13:07:25 +00:00
else
2019-05-13 18:28:35 +00:00
echo "==> dotfiles already installed"
2019-05-14 10:20:35 +00:00
echo "==> running git pull origin master"
2019-05-13 18:28:35 +00:00
cd $BASE
2019-05-14 10:20:35 +00:00
git pull origin master
2019-03-25 13:04:20 +00:00
fi
2019-03-25 09:28:39 +00:00
2019-05-27 12:02:38 +00:00
# shell related dotfiles
2019-03-25 09:28:39 +00:00
ln -fs ${BASE}/bashrc ${HOME}/.bashrc
ln -fs ${BASE}/bash_profile ${HOME}/.bash_profile
ln -fs ${BASE}/bash_aliases ${HOME}/.bash_aliases
2019-03-25 12:58:16 +00:00
ln -fs ${BASE}/zshrc ${HOME}/.zshrc
ln -fs ${BASE}/gitignore ${HOME}/.gitignore
2019-05-14 10:20:35 +00:00
# if [ -f "${HOME}/.hyper.js" ]; then
# ln -fs ${BASE}/hyper.js ${HOME}/.hyper.js
# fi
2019-05-14 10:20:35 +00:00
2019-05-27 12:02:38 +00:00
# VSCode or VSCodium
2021-06-22 10:23:36 +00:00
#if [ -d "${HOME}/.config/Code/User" ]; then
# ln -fs ${BASE}/vscode-settings.json ${HOME}/.config/Code/User/settings.json
#elif [ -d "${HOME}/.config/VSCodium/User" ]; then
# ln -fs ${BASE}/vscode-settings.json ${HOME}/.config/VSCodium/User/settings.json
#elif [ -d "${HOME}/.config/Codium/User" ]; then
# ln -fs ${BASE}/vscode-settings.json ${HOME}/.config/VSCodium/User/settings.json
#fi
2019-03-25 09:28:39 +00:00
2019-05-27 12:02:38 +00:00
# Git user config
2019-03-25 12:58:16 +00:00
git config --global user.email "raphael@crvx.fr"
git config --global user.name "sundowndev"
2019-03-25 09:28:39 +00:00
2019-09-21 14:17:55 +00:00
# If npm is installed, disable scripts at package installation
if type -p "npm" > /dev/null; then
npm config set ignore-scripts true
fi
2019-03-25 09:28:39 +00:00
# vim
2019-03-25 12:58:16 +00:00
#mkdir -p ~/.vim/autoload
#curl --insecure -fLo ~/.vim/autoload/plug.vim https://raw.github.com/junegunn/vim-plug/master/plug.vim
#mv -v ~/.vimrc ~/.vimrc.old 2> /dev/null
#ln -sf $BASE/vimrc ~/.vimrc
#vim +PlugInstall +qall
2019-05-13 18:28:35 +00:00
echo "==> script executed"