-
Notifications
You must be signed in to change notification settings - Fork 23
/
macinstall.sh
executable file
·52 lines (39 loc) · 1.04 KB
/
macinstall.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
#!/bin/sh
function checkInstall()
{
pid=$1;
name=$2;
type -P $pid &>/dev/null && echo "- $name is already installed" || {
read -p "Do you want to install $name? [y/n]: " install
if [ $install == "y" ]; then
toinstall=("${toinstall[@]}" "$pid")
fi
}
}
# imagemagick
# my bash_profile
checkInstall brew "HomeBrew"
checkInstall wget "Wget"
checkInstall node "Node.js"
read -p "Do you want a bash_profle file with some cool features? [y/n]: " bash_p
if [ $bash_p == "y" ]; then
toinstall=("${toinstall[@]}" "bash_p")
fi
echo "Those software will be installed: ${toinstall[@]}";
read -p "Let's do it now? [y/n]: " install
if [ $install == "n" ]; then
exit;
fi
for i in "${toinstall[@]}"
do
echo "[INSTALLING $i]"
if [ $i == "brew" ]; then
ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"
brew doctor;
elif [ $i == "bash_p" ]; then
(cd ~ && wget https://raw.github.com/erwanjegouzo/MacStuff/master/bash_profile && mv bash_profile .bash_profile);
else
brew install $i;
fi
done
npm install http-server