-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.sh
executable file
·82 lines (68 loc) · 2.31 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/sh
.vim#!/bin/sh
###############################################################################
# Variables
###############################################################################
# directory paths
BACKUP_DIR="dotfiles_backup"
CURRENT_DIR=$(pwd)
###############################################################################
# Functions
###############################################################################
create_backup_dir() {
echo "Creating backup directory."
mkdir -p ~/$BACKUP_DIR
}
install_dotfiles() {
echo "Archiving old dotfiles and creating symlinks for new ones."
files=( ".zprofile" ".editorconfig" ".exports" ".gitconfig" ".gitignore" ".gvimrc" ".vimrc" ".vimr" ".vim" )
for file in "${files[@]}"
do
echo "Moving ~/$file to ~/$BACKUP_DIR/$file"
mv ~/$file ~/$BACKUP_DIR/$file
ln -s $CURRENT_DIR/$file ~/$file
done
echo "Done installing dotfiles!"
}
open_tabs() {
echo "Opening links to apps."
echo ">> Chrome"
open https://www.google.com/intl/en/chrome/browser/
echo ">> Chrome Canary"
open http://www.google.com/intl/en/chrome/browser/canary.html
echo ">> Dropbox"
open https://www.dropbox.com
echo ">> Firefox"
open http://www.mozilla.org/en-US/firefox/new/
echo ">> Git"
open http://git-scm.com/downloads
echo ">> iTerm2"
open http://www.iterm2.com/
echo ">> Sequel Pro"
open http://www.sequelpro.com
}
install_homebrew() {
echo "Installing Homebrew, MySQL, ack, wget, & tree."
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
brew update
brew install mysql ack wget tree
}
###############################################################################
# User Prompts
###############################################################################
echo "Should I create a folder to backup your current dotfiles?"
echo "y/n"
read prompt_backup
[[ "$prompt_backup" == 'y' ]] && create_backup_dir
echo "Should I create symlinks to the new dotfiles?"
echo "y/n"
read prompt_symlinks
[[ "$prompt_symlinks" == 'y' ]] && install_dotfiles
echo "Should I open tabs for system applications (e.g. Chrome, Dropbox, etc...)?"
echo "y/n"
read prompt_links
[[ "$prompt_links" == 'y' ]] && open_tabs
echo "Should I install Homebrew and MySQL?"
echo "y/n"
read prompt_homebrew
[[ "$prompt_homebrew" == 'y' ]] && install_homebrew