-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·35 lines (29 loc) · 880 Bytes
/
setup.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
#!/usr/bin/env bash
set -eu
function package-check() {
[ -x "$(command -v $package)" ]
}
function package-install() {
local package=$1
local action=$2
if package-check $package; then
echo "$package is already installed."
else
echo "Installing $package."
bash -c "$action"
fi
}
function package-install-xcode-command-line-tools() {
# https://apple.stackexchange.com/a/219508
if type xcode-select >&- &&
xpath=$( xcode-select --print-path ) &&
test -d "${xpath}" &&
test -x "${xpath}" ; then
echo "Xcode Command Line Tools is already installed."
else
xcode-select --install
fi
}
package-install-xcode-command-line-tools
package-install "brew" "curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh"
package-install "ansible" "brew install ansible"