-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinstall
More file actions
executable file
·54 lines (45 loc) · 1.11 KB
/
Copy pathinstall
File metadata and controls
executable file
·54 lines (45 loc) · 1.11 KB
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
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
has() { command -v "$1" >/dev/null 2>&1; }
install_linux_prereqs() {
echo "==> Installing Homebrew prerequisites (apt)"
sudo apt-get update
sudo apt-get install -y build-essential procps curl file git
}
install_homebrew() {
if has brew; then return; fi
echo "==> Installing Homebrew"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
for candidate in \
/opt/homebrew/bin/brew \
/usr/local/bin/brew \
/home/linuxbrew/.linuxbrew/bin/brew
do
if [[ -x "$candidate" ]]; then
eval "$("$candidate" shellenv)"
break
fi
done
}
install_brew_bundle() {
echo "==> Installing Brewfile bundle"
brew bundle --file="$SCRIPT_DIR/Brewfile"
}
mkdir -p ~/.config
case "$(uname)" in
Darwin)
install_homebrew
install_brew_bundle
;;
Linux)
has brew || install_linux_prereqs
install_homebrew
install_brew_bundle
;;
*)
echo "Unsupported OS: $(uname)" >&2
exit 1
;;
esac
yes | rake install:configuration_files