-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·91 lines (56 loc) · 1.45 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
#!/usr/bin/env bash
set -e
POSITIONAL=()
while [[ $# -gt 0 ]]; do
key="$1"
case "$key" in
-l|--local)
LOCAL=1
shift
;;
-h|--help)
cat <<EOF
Command usage:
./install.sh -h|--help
Options:
⌾ -d, --debug Print help command.
⌾ -h, --help Print help command.
Help:
This installer will bootsrap a Mac installing commun software and libraries.
``./install.sh``
EOF
exit 0;
;;
-d|--debug)
set -xeu
shift
;;
*)
POSITIONAL+=("$1")
shift
;;
esac
done
set -- "${POSITIONAL[@]}"
if [[ -z ${LOCAL} ]]; then
cd $HOME
# Removing legacy way of installing.
rm -rf ${TMPDIR}master.zip
rm -rf ${TMPDIR}bootstrapMac-master
curl -L https://github.com/killua99/bootstrapMac/archive/master.zip --output master.zip
unzip -qq -d ${HOME}/ master.zip
rm -rf .bootstrapMac
mv bootstrapMac-master .bootstrapMac
cd .bootstrapMac
${HOME}/.bootstrapMac/install.sh -l
exit 0
fi
STATUS_XCODE=`xcode-select -p 1>/dev/null; printf $?`
if [[ STATUS_XCODE == 2 ]]; then
xcode-select --install
fi
[ ! -x "$(which brew)" ] && /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
[ -x "$(which brew)" ] && sudo chown -R $(whoami) $(brew --prefix)/*`
[ -x "$(which brew)" ] && sudo chmod -R 775 $(brew --prefix)/*`
[ ! -x "$(which ansible-playbook)" ] && brew install ansible
ansible-playbook bootstrap.yml