-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·33 lines (26 loc) · 813 Bytes
/
setup.sh
File metadata and controls
executable file
·33 lines (26 loc) · 813 Bytes
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
#!/bin/bash
function set_shell() {
if [[ $SHELL != /bin/bash ]]; then
echo "Switching shell to bash"
chsh -s /bin/bash
fi
}
set_shell
set -eo pipefail
ln -s "$PWD/.bash_profile" "$HOME/.bash_profile"
mkdir -p "$HOME/.ssh/"
ln -s "$PWD/.ssh/config" "$HOME/.ssh/config"
ln -s "$PWD/.gitconfig" "$HOME/.gitconfig"
which -s brew || (echo 'Install homebrew first'; exit 1)
which -s realpath || brew install coreutils
brew list bash-completion >>/dev/null 2>&1 || brew install bash-completion
function set_project_home() {
read -r -ep "Which directory is project home? (~/Projects/): " proj_dir
if [ -z "$proj_dir" ]; then
proj_dir="$HOME/Projects/"
fi
echo "export PROJECTHOME=$(realpath "${!proj_dir*}")" >> ~/.bash_variables
}
set_project_home
# shellcheck source=/dev/null
source ~/.bash_profile