Dotfiles install and backup script

This commit is contained in:
2019-09-04 16:19:59 -04:00
parent 63a9f7a787
commit 9e6448c6ae
2 changed files with 37 additions and 0 deletions

16
scripts/dotfiles.sh Normal file
View File

@ -0,0 +1,16 @@
#! /bin/bash
# source backup sudo
files=(~/.zshrc ~/.config/.dotfiles/.zshrc 'n')
for (( i=0; i<${#files[@]} ; i+=3 )) ; do
if [[ $* == *-b* ]]; then
cp ${files[i]} ${files[i+1]}
else
if [[ ${files[i+2]} == *'y'* ]]; then
sudo cp ${files[i+1]} ${files[i]}
else
cp ${files[i+1]} ${files[i]}
fi
fi
done