Last active
June 16, 2023 01:14
-
-
Save nikolovlazar/195f33efd2cd20bb99bdc6263076cca4 to your computer and use it in GitHub Desktop.
Dotfiles installation script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone --depth 1 https://github.com/wbthomason/packer.nvim ~/.local/share/nvim/site/pack/packer/start/packer.nvim | |
git clone --bare https://github.com/nikolovlazar/dotfiles.git $HOME/.dotfiles | |
function dotfiles { | |
/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME $@ | |
} | |
mkdir -p .config-backup | |
dotfiles checkout | |
if [ $? = 0 ]; then | |
echo "Checked out config."; | |
else | |
echo "Backing up pre-existing dot files."; | |
config checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | xargs -I{} mv {} .config-backup/{} | |
fi; | |
dotfiles checkout | |
dotfiles config status.showUntrackedFiles no |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment