-
Notifications
You must be signed in to change notification settings - Fork 0
/
mac
executable file
·57 lines (44 loc) · 1.09 KB
/
mac
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
#!/usr/bin/env bash
set -e
echo "Homebrew - package manager"
if ! which brew > /dev/null 2>&1; then
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
# $1 - brew package name (e.g. "neovim")
# $2 - command name (e.g. "nvim")
#
# when $2 is blank uses $1
function install_or_update {
CMD="$2"
if [ -z "$CMD" ]; then
CMD="$1"
fi
# Check is package is installed
if which $CMD > /dev/null 2>&1; then
# Check is package is outdated
if (brew outdated | grep -q package_name ); then
brew upgrade $1 > /dev/null
fi
else
brew install $1
fi
}
brew update > /dev/null
echo "stow - symlink manager"
install_or_update "stow"
echo "ruby"
install_or_update "ruby-install"
install_or_update "chruby"
echo "n - node version manager"
install_or_update "n"
echo "yarn - node package manager"
install_or_update "yarn"
echo "tldr - man pages with example"
install_or_update "tldr"
echo "golang"
mkdir -p $HOME/go
install_or_update "go"
echo "jq - json processor"
install_or_update "jq"
echo "sed - gnu sed"
# install_or_update "