-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·61 lines (48 loc) · 1.56 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
#!/bin/zsh
if [ -z $DEFAULT_SHELL_DIR ]
then
echo "No default shell dir set, defaulting to $HOME"
export DEFAULT_SHELL_DIR=$HOME
fi
echo "### INSTALLING OH MY ZSH ###"
if [ -d $HOME/.oh-my-zsh ]
then
echo "oh-my-zsh already installed, updating instead"
$HOME/.oh-my-zsh/tools/upgrade.sh 1> /dev/null
else
# On top of being a great library to use, oh-my-zsh will do the following things on install:
# - ensure git is installed,
# - ensure zsh is installed,
# - change the default shell to zsh
export RUNZSH=no
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" 1> /dev/null
fi
echo "### INSTALLING PURE ###"
mkdir -p "$HOME/.zsh"
echo "Existing pure installation found, removing"
if [ -d $HOME/.zsh/pure ]
then
rm -rf $HOME/.zsh/pure
fi
git clone --quiet https://github.com/sindresorhus/pure.git "$HOME/.zsh/pure"
echo "### COPYING ZSHRC FILE ###"
cp ./zshrc.zsh $HOME/.zshrc
sed -i '' "s,{{DEFAULT_SHELL_DIR}},$DEFAULT_SHELL_DIR,g" $HOME/.zshrc
echo "### Installing Difftastic ###"
which difft 1> /dev/null
difftastic_installed=$?
if [[ $difftastic_installed -ne 0 ]]; then
echo "difftastic not installed, checking for brew"
which brew 1> /dev/null
brew_installed=$?
if [[ $brew_installed -eq 0 ]]; then
echo "Brew installed, installing difftastic"
brew install --quiet difftastic
else
echo "Brew not installed, difftastic was not installed"
fi
else
echo "difftastic already installed, skipping"
fi
echo "### RELOADING TERMINAL ###"
exec zsh