-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure-zsh.sh
More file actions
executable file
·31 lines (27 loc) · 1.02 KB
/
configure-zsh.sh
File metadata and controls
executable file
·31 lines (27 loc) · 1.02 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
#!/usr/bin/env sh
# zshrc
if test -e "$HOME/.zshrc" && ! test -w "$HOME/.zshrc"
then
echo 'Not able to modify "$HOME/.zshrc"'
exit 1
fi
if ! grep -Fxq '# Source zshrc from dotfiles' "$HOME/.zshrc" 2>/dev/null
then
printf '# Source zshrc from dotfiles\nif test -r "$HOME/.zshrc_dotfiles"; then source "$HOME/.zshrc_dotfiles"; fi\n\n' | cat - "$HOME/.zshrc" 2>/dev/null | tee "$HOME/.zshrc" > /dev/null
echo 'zshrc_dotfiles sourced in zshrc'
else
echo 'zshrc_dotfiles already sourced in zshrc'
fi
# zprofile
if test -e "$HOME/.zprofile" && ! test -w "$HOME/.zprofile"
then
echo 'Not able to modify "$HOME/.zprofile"'
exit 1
fi
if ! grep -Fxq '# Source zprofile from dotfiles' "$HOME/.zprofile" 2>/dev/null
then
printf '# Source zprofile from dotfiles\nif test -r "$HOME/.zprofile_dotfiles"; then source "$HOME/.zprofile_dotfiles"; fi\n\n' | cat - "$HOME/.zprofile" 2>/dev/null | tee "$HOME/.zprofile" > /dev/null
echo 'zprofile_dotfiles sourced in zprofile'
else
echo 'zprofile_dotfiles already sourced in zprofile'
fi