Setup script will now backup existing config files
This commit is contained in:
parent
79c5034593
commit
ef9b5655ca
1 changed files with 13 additions and 6 deletions
19
setup.sh
19
setup.sh
|
@ -2,16 +2,23 @@
|
||||||
|
|
||||||
commandExists()
|
commandExists()
|
||||||
{
|
{
|
||||||
command -v "$1" >/dev/null 2>&1
|
command -v "$1" >/dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
backupFilesIfExists()
|
||||||
|
{
|
||||||
|
if [ -f $1 ] || [ -h $1 ] || [ -d $1 ]; then
|
||||||
|
printf "Found $1. Backing up to $1.pre-dotfiles\n";
|
||||||
|
mv $1 $1.pre-dotfiles;
|
||||||
|
fi
|
||||||
|
}
|
||||||
# remove all current dotfiles
|
# remove all current dotfiles
|
||||||
echo '[INFO] Removing current dotfiles...'
|
echo '[INFO] Removing current dotfiles...'
|
||||||
rm -f ~/.zshrc
|
backupFilesIfExists ~/.zshrc
|
||||||
rm -f ~/.vimrc
|
backupFilesIfExists ~/.vimrc
|
||||||
rm -rf ~/.vim
|
backupFilesIfExists ~/.vim
|
||||||
rm -f ~/.tmux.conf
|
backupFilesIfExists ~/.tmux.conf
|
||||||
rm -rf ~/.atom
|
backupFilesIfExists ~/.atom
|
||||||
|
|
||||||
# create symbolic links to dotfiles
|
# create symbolic links to dotfiles
|
||||||
echo '[INFO] Creating symlinks to new config files in .dotfiles...'
|
echo '[INFO] Creating symlinks to new config files in .dotfiles...'
|
||||||
|
|
Loading…
Add table
Reference in a new issue