-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmac-utils.sh
More file actions
88 lines (81 loc) · 2.36 KB
/
mac-utils.sh
File metadata and controls
88 lines (81 loc) · 2.36 KB
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
cyan " - brew"
which brew > /dev/null
if [ $? -eq 0 ]; then
cyan - " - Homebrew already installed, skipping"
else
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
# brew: tree, neovim/neovim/neovim, the_silver_searcher, wget, coreutils, tmux, jq
BASEUTILS=(tree wget coreutils tmux jq)
cyan " - base utils"
for util in ${BASEUTILS[@]}
do
cyan " - $util"
if [ -n "$(brew ls --versions $util)" ]; then
cyan " - $util already installed, skipping"
else
brew install $util
fi
done
cyan " - neovim"
if [ -n "$(brew ls --versions neovim)" ]; then
cyan " - neovim already installed, skipping"
else
brew install neovim/neovim/neovim
ln -s $(which nvim) ~/bin/vim
fi
cyan " - ag"
if [ -n "$(brew ls --versions the_silver_searcher)" ]; then
cyan " - ag already installed, skipping"
else
brew install the_silver_searcher
fi
cyan " - pick"
if [ -s ~/bin/pick ]; then
cyan " - Found ~/bin/pick already, skipping"
else
(
set -e
wget https://github.com/thoughtbot/pick/releases/download/v$PICK_VER/pick-$PICK_VER.tar.gz
tar xzvf pick-$PICK_VER.tar.gz
mkdir -p ~/lib/pick
cd pick-$PICK_VER
./configure --prefix=$HOME/lib/pick
make
make install
cd $root_dir
rm pick-$PICK_VER.tar.gz
rm -r pick-$PICK_VER
ln -s $HOME/lib/pick/bin/pick ~/bin/pick
) > $root_dir/logs/pick 2>&1
# http://unix.stackexchange.com/questions/65532/why-does-set-e-not-work-inside
if [ "$?" -ne 0 ]; then
red " - Something went wrong. Check logs/pick."
else
green " - Success!"
fi
fi
cyan " - markdown"
if [ -s ~/bin/markdown ]; then
cyan " - Found ~/bin/markdown already, skipping"
else
(
set -e
wget http://daringfireball.net/projects/downloads/Markdown_1.0.1.zip
unzip Markdown_1.0.1.zip
rm Markdown_1.0.1.zip
mv Markdown_1.0.1 ~/lib/markdown
ln -s ~/lib/markdown/Markdown.pl ~/bin/markdown
) >$root_dir/logs/markdown 2>&1
if [ "$?" -ne 0 ]; then
red " - Something went wrong. Check logs/markdown"
else
green " - Success!"
fi
fi
cyan " - diff-so-fancy"
if [ -n "$(brew ls --versions diff-so-fancy)" ]; then
cyan " - diff-so-fancy already installed, skipping"
else
brew install diff-so-fancy
fi