-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·54 lines (41 loc) · 1.1 KB
/
install.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
#!/bin/bash
set -eu
HOMEBREW_DOWNLOAD_URL=https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh
install_homebrew() {
echo "Checking for Homebrew, and installing if necessary"
if ! [[ $( command -v brew ) ]]; then
echo 'Installing homebrew...'
/bin/bash -c "$(curl -fsSL $HOMEBREW_DOWNLOAD_URL)"
else
echo 'Homebrew installed.'
fi
eval "$(/opt/homebrew/bin/brew shellenv)"
}
# TODO - use brew bundle
install_packages() {
echo "Installing packages..."
brew install stow > /dev/null || brew upgrade stow > /dev/null
}
stow_files() {
# Link other files
stow bash
stow git
stow emacs
stow misc # all other things that don't fit cleanly in a category
# Link .bash_profile -> .bashrc
rm -f ~/.bash_profile
ln -s ~/.bashrc ~/.bash_profile
}
setup() {
# create symlink for org files sync with iCloud
ln -s ~/Library/Mobile\ Documents/iCloud~com~appsonthemove~beorg/Documents/org ~/.org
}
main() {
install_homebrew
install_packages
stow_files
setup
}
main
echo ""
echo "SUCCESS. Restart the terminal app for the new config to take effect."