-
Notifications
You must be signed in to change notification settings - Fork 0
/
oh-my-zsh.zsh
executable file
·47 lines (36 loc) · 1.33 KB
/
oh-my-zsh.zsh
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
source $HOME/dotfiles/helper.sh
input "${ORANGE}Do you want to replace your current dotfiles with the new ones? (.aliases and .zshrc) Backups will be made"
if [ $ANSWER ]; then
cd $HOME/dotfiles
ZSH_FILE=$HOME/.zshrc
ZSH_BACKUP=$HOME/.zshrc.backup
if [ ! -x "$(command -v zsh)" ]; then
# Install Zsh if not already installed
./zsh.sh
echo "${RED}Re-run this script after you've done so${NC}"
exit 0
fi
echo
echo -e "${ORANGE}Backing up current dotfiles...${NC}"
if [ -f $ZSH_FILE ]; then
mv $ZSH_FILE $ZSH_BACKUP # Backing up current .zshrc file
echo -e "${ORANGE}Renamed current ${RED}~/.zshrc${NC} ${ORANGE}to ${GREEN}~/.zshrc.backup${NC}"
fi
if [ -f $HOME/.aliases ]; then
mv $HOME/.aliases $HOME/.aliases.backup # Backing up current .aliases files
echo -e "${ORANGE}Renamed current ${RED}~/.aliases${NC} ${ORANGE}to ${GREEN}~/.aliases.backup${NC}"
fi
echo -e "${ORANGE}Symlinking dotfiles...${NC}"
ln -sf $HOME/dotfiles/.zshrc $HOME
ln -sf $HOME/dotfiles/.aliases $HOME
source $ZSH_FILE
echo
echo "${GREEN}Finished symlinking dotfiles.${NC}"
echo
fi
input "${ORANGE}Do you wish to install Zgenom? (Zsh plugin manager)"
if [ $ANSWER ]; then
# Zgenom plugin manager for ZSH
# https://github.com/jandamm/zgenom
git clone https://github.com/jandamm/zgenom.git "${HOME}/.zgenom"
fi