-
Notifications
You must be signed in to change notification settings - Fork 2
/
install.sh
executable file
·130 lines (105 loc) · 3.78 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
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#!/bin/bash
################
# Script setup #
################
# Get directory of where this install script is located
SHELL_NAME=$(ps -p $$ -ocomm=)
case "$SHELL_NAME" in
*bash)
SCRIPT_LOC=${BASH_SOURCE[0]}
;;
*zsh)
SCRIPT_LOC=${(%):-%N}
;;
*)
echo "install.sh must be run under either bash or zsh."
exit 1
esac
DOTFILES_DIR=$(dirname $SCRIPT_LOC)
# Move to the root location of where the dotfiles repo was cloned to
cd $DOTFILES_DIR
# Source utilities
if [[ -d ./utility.d ]]; then
for file in ./utility.d/*.sh; do
source $file
done
fi
# Make sure some particular files exist
touch $HOME/.bash_profile
touch $HOME/.bashrc
############
# OS setup #
############
if is_osx; then
echo "-----------------------------------------"
echo "| Installing dependencies for OSX/macOS |"
echo "-----------------------------------------"
echo
source ./install_osx.sh
fi
##################
# Language setup #
##################
echo "------------------------------------"
echo "| Installing programming languages |"
echo "------------------------------------"
echo
source ./install_language.sh
##################
# Dotfiles setup #
##################
export DOTFILES=$(pwd)
echo "------------------------------"
echo "| Installing local dotfiles |"
echo "------------------------------"
echo
source ./install_dotfiles.sh
# Set up the environment to point to where the dotfiles are located
echo "export DOTFILES=$DOTFILES" >> $HOME/.init_env
##############
# User setup #
##############
echo "-----------------------"
echo "| Setting up the user |"
echo "-----------------------"
echo
echo "Creating local file structure..."
mkdir $HOME/Development
mkdir $HOME/Development/github
###############
# Shell setup #
###############
echo "------------------------"
echo "| Setting up the shell |"
echo "------------------------"
echo
source ./install_shell.sh
if [ -x /bin/zsh ]; then
echo "Setting zsh as the default shell..."
echo
chsh -s /bin/zsh
fi
###########################################################
# Manual configuration (left as an exercise for the user) #
###########################################################
echo "-------------------------------------------------------------"
echo
echo "All done! Phew, thanks for waiting :)."
echo "There's a few manual steps left, that you'll need to finish by yourself:"
echo
echo " - Please install the tmux plugins by invoking PREFIX+I (see https://github.com/tmux-plugins/tpm#installing-plugins)"
echo " - Please set up your git user config (see https://help.github.com/articles/setting-your-username-in-git/)"
echo " - Please set up SSH keys for Github by visiting https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/"
echo " - Please set up GPG keys for Github by visiting https://help.github.com/articles/signing-commits-with-gpg/"
if is_osx; then
echo " - Some macOS-specific manual setup:"
echo " - Some homebrewed apps may require manual setup, please see the logs above"
echo " - Set up Better Touch Tool to use the saved preferences at $DOTFILES/osx.d/bettertouchtool/ by importing the preferences"
echo " - Set up iterm2 to use the saved preferences at $DOTFILES/osx.d/iterm2/"
echo " - Set up karabiner to use the saved preferences at $DOTFILES/osx.d/karabiner/ by copying the folder into ~/.config/karabiner/"
echo " - Set up spectacle to use the saved preferences at $DOTFILES/osx.d/spectacle/ by copying the folder into ~/Library/Application\ Support/Spectacle/"
echo " - You might have to fix the patched Source Code Pro font using FontBook (see https://github.com/ryanoasis/nerd-fonts/issues/258)."
fi
echo
echo "Note that some of these changes require a logout/restart to take effect."
echo