forked from matdurand/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.sh
executable file
·49 lines (39 loc) · 1 KB
/
bootstrap.sh
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
#!/usr/bin/env bash
cd "$(dirname "${BASH_SOURCE}")";
git pull origin master;
function clean() {
[[ -d ~/.zplug ]] && rm -rf ~/.zplug
}
function setup() {
#Copy files
rsync --exclude ".git/" \
--exclude ".DS_Store" \
--exclude "*.sh" \
--exclude "scripts" \
--exclude "prezto" \
--exclude "screenshots" \
--exclude "README.md" \
--exclude "LICENSE" \
-avh --no-perms . ~;
source ./scripts/brew.sh
#Change shell
echo "Changing your shell to ZSH"
chsh -s /bin/zsh
sudo dscl . -create /Users/$USER UserShell /usr/local/bin/zsh
zsh -c "source ~/.zshrc && echo Zplug Installed" &
wait $!
source ./scripts/prezto-install.sh
source ./scripts/gitsetup.sh
}
function readVariables() {
read -p 'Enter your git user name:' GIT_USER_NAME
read -p 'Enter your git user email:' GIT_USER_EMAIL
}
read -p "This may overwrite existing files in your home directory. Are you sure? (y/n) " -n 1;
echo "";
if [[ $REPLY =~ ^[Yy]$ ]]; then
readVariables;
clean;
setup;
fi;
unset setup;