-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbootstrap.sh
More file actions
71 lines (55 loc) · 2.11 KB
/
bootstrap.sh
File metadata and controls
71 lines (55 loc) · 2.11 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/env bash
# cd "$(dirname "${BASH_SOURCE}")";
# git pull origin master;
# Where I keep my configs, because Mackup.
syncdir="$HOME/Dropbox/Apps/Configs"
function doIt() {
rsync -l --exclude "apps/" --exclude "setup/" --exclude ".git/" \
--exclude ".gitignore" --exclude ".gitmodules" --exclude ".DS_Store" \
--exclude "bootstrap.sh" --exclude ".editorconfig" \
--exclude "README.md" -avh --no-perms . $syncdir;
source ~/.bash_profile;
}
if [ "$1" == "--force" -o "$1" == "-f" ]; then
doIt;
else
read -p "This may overwrite existing files in your home directory. Are you sure? (y/n) " -n 1;
echo "";
if [[ $REPLY =~ ^[Yy]$ ]]; then
doIt;
fi;
fi;
unset doIt;
# Gonna backup my sublime settings here when I update my dots.
\rm -rf ./apps/sublime/User/*
\cp -rf $syncdir/Library/Application\ Support/Sublime\ Text\ 3/Packages/User/*.sublime-settings ./apps/sublime/User/
######################################
# Post Updots Things
######################################
# I wrote the below crappy little script to check to see if there are any
# files in my repo that I've forgotten to add to my mackup config files.
#
# It could maybe be better.
# Files in the sync directory we can ignore
ignore=(. .. .DS_Store .MacOSX Library )
# Files I know are already in my custom mackup config
localcfg=( bin .bash_prompt .dircolors .eslintrc .exports .extra .functions \
.hushlogin .path .mackup .mackup.cfg )
# Files I know mackup is already accounting for
mackup=( .aws .aliases .bash_aliases .bash_login .bash_logout .bashrc \
.bash_profile .fzf.bash .inputrc .config .gemrc .git_template \
.gitconfig .gitattributes .gitconfig.local .gitignore_global .gvimrc \
.hgrc .hgignore_global .htoprc .i2csshrc .irssi .curlrc \
.pearrc .ssh .subversion .vim .vimrc .gnupg )
# ALL THE THINGS
allfiles=( "${ignore[@]}" "${localcfg[@]}" "${mackup[@]}" )
contains () {
local e
for e in "${@:2}"; do [[ "$e" == "$1" ]] && return 0; done
return 1
}
for f in $syncdir/*; do
file=${f##*/}
contains "$file" "${allfiles[@]}"
test "$?" == 1 && (echo ${f##*/};)
done