-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.sh
More file actions
executable file
·42 lines (31 loc) · 992 Bytes
/
Copy pathbootstrap.sh
File metadata and controls
executable file
·42 lines (31 loc) · 992 Bytes
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
#!/bin/sh
# Welcome to the my mac-devenv
# It is forked from https://github.com/siyelo/laptop
fancy_echo() {
local fmt="$1"; shift
# shellcheck disable=SC2059
printf "\n$fmt\n" "$@"
}
fancy_echo "Boostrapping ..."
trap 'ret=$?; test $ret -ne 0 && printf "failed\n\n" >&2; exit $ret' EXIT
set -e
if ! command -v cc >/dev/null; then
fancy_echo "Installing xcode ..."
xcode-select --install
else
fancy_echo "Xcode already installed. Skipping."
fi
if ! command -v brew >/dev/null; then
fancy_echo "Installing Homebrew..."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" </dev/null
else
fancy_echo "Homebrew already installed. Skipping."
fi
# [Install Ansible](http://docs.ansible.com/intro_installation.html).
if ! command -v ansible >/dev/null; then
fancy_echo "Installing Ansible ..."
brew install ansible
else
fancy_echo "Ansible already installed. Skipping."
fi
ansible-playbook dev.yml -i hosts -c local -vv