-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall-config
More file actions
33 lines (24 loc) · 1.03 KB
/
install-config
File metadata and controls
33 lines (24 loc) · 1.03 KB
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
# install-config
#
# from: https://bitbucket.org/snippets/nicolapaolucci/7rE9K
# =========================================================
echo ''
printf "\r [ \033[00;34m..\033[0m ] Installing .myconfig bare repository ...\n"
printf "\r [ \033[00;34m..\033[0m ] Stock configuration files will automatically move to .config-backup\n"
git clone --bare https://github.com/dNitro/dotfiles.git $HOME/.myconfig
function config {
$(which git) --git-dir=$HOME/.myconfig/ --work-tree=$HOME $@
}
mkdir -p .config-backup
config checkout
if [ $? = 0 ]; then
printf "\r [ \033[00;34m..\033[0m ] Checked out config.\n"
else
printf "\r [ \033[00;34m..\033[0m ] Backing up pre-existing dot files.\n"
config checkout 2>&1 | egrep "\s+\." | sed 's/\/.*//' | sort -u | awk {'print $1'} | xargs tar cf - --remove-files | (cd .config-backup; tar xvf -)
config checkout
printf "\r [ \033[00;34m..\033[0m ] Checked out config.\n"
fi;
config config status.showUntrackedFiles no
printf "\r\033[2K [ \033[00;32mOK\033[0m ] Done!\n"
echo ''