mirror of
https://github.com/chenasraf/git-open.git
synced 2026-05-18 01:38:59 +00:00
fix: avoid polluting main shell
This commit is contained in:
@@ -298,3 +298,9 @@ case $1 in
|
||||
git_open $@
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ -z "$__UNLOAD_PATH" ]]; then
|
||||
__UNLOAD_PATH="${0:A:h}/unload.zsh"
|
||||
fi
|
||||
|
||||
source "$__UNLOAD_PATH"
|
||||
|
||||
@@ -4,7 +4,9 @@ if [[ -z "$TERM" ]]; then
|
||||
export TERM=xterm-256color
|
||||
fi
|
||||
### Setup
|
||||
__UTILS_PATH="${0:A:h}/utils.mock.zsh" source "${0:A:h}/../git-open.zsh"
|
||||
__UTILS_PATH="${0:A:h}/utils.mock.zsh" \
|
||||
__UNLOAD_PATH="/dev/null" \
|
||||
source "${0:A:h}/../git-open.zsh"
|
||||
|
||||
assert_value() {
|
||||
local expected="$1"
|
||||
|
||||
5
unload.zsh
Normal file
5
unload.zsh
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
unset -f git_open git_open_project git_open_branch git_open_file git_open_commit \
|
||||
git_open_pr_list git_open_new_pr git_open_pipelines uriencode git_get_remote \
|
||||
git_get_repo_path git_get_remote_type open_url
|
||||
Reference in New Issue
Block a user