Skip to content

Commit ec7beb5

Browse files
committed
Replace hard-coded paths with local variable
1 parent 172128e commit ec7beb5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/venv-cli/uninstall.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ uninstall_common() {
1313
local completion_target="$2"
1414

1515
# Remove the line from shell config that sources the script
16-
sed -i "\|.*Source autocompletions for 'venv' command|d" "${HOME}/.bashrc"
17-
sed -i "\|\. ${_venv_dir}/venv|d" "${HOME}/.bashrc"
16+
sed -i "\|.*Source autocompletions for 'venv' command|d" "${rcfile}"
17+
sed -i "\|\. ${_venv_dir}/venv|d" "${rcfile}"
1818

1919
if [ -f "${completion_target}" ]; then
2020
sudo rm "${completion_target}"
@@ -33,8 +33,8 @@ uninstall_zsh() {
3333
local completion_target="/usr/local/share/zsh/site-functions/_venv"
3434

3535
uninstall_common "${rcfile}" "${completion_target}"
36-
sed -i "\|fpath+=( ${_install_dir} )|d" "${HOME}/.zshrc"
37-
sed -i "\|autoload -Uz venv|d" "${HOME}/.zshrc"
36+
sed -i "\|fpath+=( ${_install_dir} )|d" "${rcfile}"
37+
sed -i "\|autoload -Uz venv|d" "${rcfile}"
3838
}
3939

4040
main() {

0 commit comments

Comments
 (0)