-
Notifications
You must be signed in to change notification settings - Fork 0
/
homebrew.sh
executable file
·72 lines (61 loc) · 1.49 KB
/
homebrew.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
#!/bin/bash
green=$(tput setaf 2)
gold=$(tput setaf 3)
magenta=$(tput setaf 5)
cyan=$(tput setaf 6)
red=$(tput setaf 1)
default=$(tput sgr0)
gray=$(tput setaf 243)
if hash brew 2>/dev/null; then
echo ""
else
echo -e "\n${red}Homebrew not found.\n'${cyan}Installing Homebrew${default}'"
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
function brewInstall(){
if brew ls --versions $1 >/dev/null; then
v=$(brew ls --versions $1)
echo -e "\n${green} ✓ ${cyan}$1 Installed ${default}\n $v"
else
echo -e "\n${red}$1 not found.\n${default}running '${cyan}brew install $1${default}'"
brew install $1 >/dev/null
fi
}
function brewCaskInstall(){
if brew ls --cask --versions $1 >/dev/null; then
v=$(brew ls --cask --versions $1)
echo -e "\n${green} ✓ ${cyan}$1 Installed ${default}\n $v"
else
echo -e "\n${red}$1 not found.\n${default}running '${cyan}brew install --cask $1${default}'"
brew install --cask $1 >/dev/null
fi
}
PACKAGES=(
bat
ctop
diff-so-fancy
docker
docker-compose
fig
jq
lastpass-cli
node@14
tableplus
tldr
tree
)
for p in ${PACKAGES[@]}; do
brewInstall $p
done
CASKS=(
google-chrome
rectangle
spotify
visual-studio-code
iterm2
)
for c in ${CASKS[@]}; do
brewCaskInstall $c
done
# Set up diff-so-fancy
git config --global core.pager "diff-so-fancy | less --tabs=4 -RFX"