-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathfresh-brew.local
35 lines (29 loc) · 981 Bytes
/
fresh-brew.local
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
#!/usr/bin/env bash
configure_shell_file_for_nodenv() {
if [[ $SHELL == *fish ]]; then
append_to_file "$shell_file" 'status --is-interactive; and source (nodenv init -|psub)'
else
# shellcheck disable=SC2016
append_to_file "$shell_file" 'eval "$(nodenv init -)"'
fi
}
fancy_echo "Running your customizations from fresh-brew.local ..."
if [ -f "Brewfile.local" ]; then
if brew bundle --file="Brewfile.local"; then
fancy_echo "All items in Brewfile.local were installed successfully."
else
fancy_echo "Some items in Brewfile.local were not installed successfully."
fi
fi
node_version="$(cat < ".node-version")"
fancy_echo "Installing node $node_version ..."
if nodenv versions | grep "$node_version"; then
fancy_echo "node $node_version already installed."
else
brew upgrade node-build
nodenv install "$node_version"
fi
fancy_echo "Configuring Nodenv..."
configure_shell_file_for_nodenv
fancy_echo "Launching the website..."
npm run start