-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.sh
More file actions
executable file
·38 lines (30 loc) · 947 Bytes
/
bootstrap.sh
File metadata and controls
executable file
·38 lines (30 loc) · 947 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env bash
FILES=".bash_profile .bash_aliases .bashrc .vimrc .gitconfig gitignore .tmux.conf .yamllint"
FORCE=0
time=$(date +%s)
while getopts 'f' c
do
case $c in
f) FORCE=1 ;;
esac
done
mkdir ./system_originals/$time/ || exit 1
for i in $(echo $FILES| tr ";" "\n")
do
if [ -f ~/dotfiles/system_originals/$time/$i ] && [ $FORCE = 0 ] ; then
echo "You might be overwriting the original system files."
exit 1
fi
#save files, just in case
cp ~/$i ./system_originals/$time/$i 2> /dev/null
cp ~/dotfiles/$i ~/$i
done
#Add vim templates
mkdir -p ~/.vim/templates 2> /dev/null
cp ./vim/templates/* ~/.vim/templates/
mv ~/gitignore ~/.gitignore
# TODO: I don't think this currently works.
# it might be sourcing the bqash profile for the process running the script
# Leaving for now because it makes it easier to debug
source ~/.bash_profile
echo "This output is here only to make you think something happened"