-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathinstall.sh
106 lines (92 loc) · 2.84 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
#!/bin/sh
# Exit immediately if a command exits with a non-zero status.
set -e
# Determine the directory of this script
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Paths to the sub-scripts
BREW_INSTALL_SCRIPT="$SCRIPT_DIR/scripts/install-brew.sh"
XCODE_INSTALL_SCRIPT="$SCRIPT_DIR/scripts/install-xcode.sh"
OMZSH_INSTALL_SCRIPT="$SCRIPT_DIR/scripts/install-omzsh.sh"
GIT_CONFIG_SCRIPT="$SCRIPT_DIR/scripts/setup-git.sh"
NVM_INSTALL_SCRIPT="$SCRIPT_DIR/scripts/setup-nvm.sh"
COMPOSER_INSTALL_SCRIPT="$SCRIPT_DIR/scripts/setup-composer.sh"
ZSH_ALIASES_SCRIPT="$SCRIPT_DIR/scripts/setup-aliases.sh"
MACOS_PREFS_SCRIPT="$SCRIPT_DIR/scripts/macos-prefs.sh"
# Let's get started.
cd ~
# Install Xcode
# Runs scripts/install-xcode.sh
echo "Executing xcode install script..."
if [[ -f "$XCODE_INSTALL_SCRIPT" ]]; then
bash "$XCODE_INSTALL_SCRIPT"
else
echo "Error: Script $XCODE_INSTALL_SCRIPT not found"
exit 1
fi
# Setup Git configs and gitignore
# Runs scripts/setup-git.sh
echo "Executing git config script..."
if [[ -f "$GIT_CONFIG_SCRIPT" ]]; then
bash "$GIT_CONFIG_SCRIPT"
else
echo "Error: Script $GIT_CONFIG_SCRIPT not found"
exit 1
fi
# Install Homebrew and all apps on Homebrew.
# Runs scripts/install-brew.sh
echo "Executing Brewfile installation script..."
if [[ -f "$BREW_INSTALL_SCRIPT" ]]; then
bash "$BREW_INSTALL_SCRIPT"
else
echo "Error: Script $BREW_INSTALL_SCRIPT not found"
exit 1
fi
# Install Oh My ZSH!
# Runs scripts/install-omzsh.sh
echo "Executing Oh My Zsh! install script..."
if [[ -f "$OMZSH_INSTALL_SCRIPT" ]]; then
bash "$OMZSH_INSTALL_SCRIPT"
else
echo "Error: Script $OMZSH_INSTALL_SCRIPT not found"
exit 1
fi
# Install ZSH aliases
# Runs scripts/setup-aliases.sh
echo "Installing ZSH aliases..."
if [[ -f "$ZSH_ALIASES_SCRIPT" ]]; then
bash "$ZSH_ALIASES_SCRIPT"
else
echo "Error: Script $ZSH_ALIASES_SCRIPT not found"
exit 1
fi
# Finish setting up oh-my-zsh!
omz update
# Install Node Version Manager (nvm) and global nvm libs
# Runs scripts/setup-nvm.sh
echo "Installing Node Version Manager, Setting up Node.js, and global npm libraries..."
if [[ -f "$NVM_INSTALL_SCRIPT" ]]; then
bash "$NVM_INSTALL_SCRIPT"
else
echo "Error: Script $NVM_INSTALL_SCRIPT not found"
exit 1
fi
# Install Composer and global packages
# Runs scripts/setup-composer.sh
echo "Installing Composer and global packages..."
if [[ -f "$COMPOSER_INSTALL_SCRIPT" ]]; then
bash "$COMPOSER_INSTALL_SCRIPT"
else
echo "Error: Script $COMPOSER_INSTALL_SCRIPT not found"
exit 1
fi
# Install/Update System Prefs
# Runs scripts/macos-prefs.sh
echo "Executing System Preference script..."
if [[ -f "$MACOS_PREFS_SCRIPT" ]]; then
bash "$MACOS_PREFS_SCRIPT"
else
echo "Error: Script $MACOS_PREFS_SCRIPT not found"
exit 1
fi
# Prevent duplicate PATH variables.
echo "typeset -U PATH" >>~/.zshrc