.zshrc can be found at "~/.zshrc", when ZDOTDIR is not set.
If ZDOTDIR is set, .zshrc is in "${ZDOTDIR}/.zshrc".
Using parameter expansion, the hardcoded path can be replaced with
"${ZDOTDIR:-$HOME}/.zshrc". That way, it'll use the value in
ZDOTDIR when set and the value in HOME when not.
This thus mirrors the usage of ZDOTDIR in zsh and makes the code
more fexible.
19 lines
472 B
Bash
Executable File
19 lines
472 B
Bash
Executable File
#!/bin/sh
|
|
# uninstall by (github: bernardofire)
|
|
# Remove line from bashrc and zshrc if present.
|
|
|
|
sed="sed -i"
|
|
if [[ $OSTYPE == "Darwin" ]]; then
|
|
sed="sed -i ''"
|
|
fi
|
|
|
|
if [ -f "$HOME/.bashrc" ]; then
|
|
$sed '/scm_breeze/d' "$HOME/.bashrc" &&
|
|
printf "Removed SCM Breeze from '%s'\n" "$HOME/.bashrc"
|
|
fi
|
|
|
|
if [ -f "${ZDOTDIR:-$HOME}/.zshrc" ]; then
|
|
$sed '/scm_breeze/d' "${ZDOTDIR:-$HOME}/.zshrc" &&
|
|
printf "Removed SCM Breeze from '%s'\n" "${ZDOTDIR:-$HOME}/.zshrc"
|
|
fi
|