-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall
executable file
·108 lines (89 loc) · 2.55 KB
/
install
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
#!/usr/bin/env bash
EMAIL="[email protected]"
PLATFORM="linux"
DOMAIN="personal"
UBUNTU=false
WSL=false
if [[ ! "${CODESPACES}" == true ]]; then
read -n 1 -p "Installing for (1) Linux (Ubuntu), (2) Linux, (3) MacOS? " osAns;
echo ""
read -n 1 -p "Installing for (1) personal or (2) work? " domainAns;
echo ""
case $osAns in
1)
PLATFORM="linux"
UBUNTU=true;;
2)
PLATFORM="linux";;
3)
PLATFORM="macos";;
*)
echo "Select a valid OS."
exit 1;;
esac
case $domainAns in
1)
DOMAIN="personal";;
2)
DOMAIN="work";;
*)
echo "Select personal or work for domain"
exit 1;;
esac
if [[ "${DOMAIN}" == "work" ]]; then
read -p "What email address should be used for git? " workEmail;
EMAIL=$workEmail
fi
if [[ "${PLATFORM}" == "linux" ]]; then
read -n 1 -p "Is this a WSL linux installation? (y/N) " wslAns;
echo ""
case $wslAns in
y|Y)
WSL=true;;
esac
fi
fi
# Check for homebrew
if [[ "${PLATFORM}" == "macos" ]] && ! command -v brew &> /dev/null; then
echo "install homebrew with the following /bin/bash -c \"\$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\""
exit 1
fi
# Check for zsh
if ! command -v zsh &> /dev/null; then
echo "zsh could not be found, install it first"
exit 1
fi
set -e
# Dotbot vars
DOTBOT_DIR="dotbot"
DOTBOT_BIN="bin/dotbot"
BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Clone submodules
cd "${BASEDIR}"
git -C "${DOTBOT_DIR}" submodule sync --quiet --recursive
git submodule update --init --recursive
# Remove existing zshrc if it's there
rm ~/.zshrc || true
# Setup user env
ENV_CONFIG="install.conf.yaml"
"${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" \
-d "${BASEDIR}" \
-c "${ENV_CONFIG}" \
"${@}"
echo "Setting git email to ${EMAIL}."
git config --global user.email "${EMAIL}"
echo "Recommend running the following commands:"
echo "scripts/wezterm.sh"
if [[ "${PLATFORM}" == "macos" ]]; then
echo "brew install autojump fd fzf 1password-cli wezterm jandedobbeleer/oh-my-posh/oh-my-posh"
echo "brew install --cask font-meslo-lg-nerd-font"
fi
echo "ln -s ${BASEDIR}/espanso \$(espanso path config)"
if [[ ! "${PLATFORM}" == "macos" ]]; then
echo "curl -s https://ohmyposh.dev/install.sh | bash -s"
echo "Recommend installing the following packages: fzf, fd, autojump, wezterm"
fi
if [[ $UBUNTU == true ]]; then
echo "Recommend installing nala"
fi
echo "Recommend installing the following node packages: typescript, @angular/cli, lorem-ipsum-cli, better-commits"