Skip to content

Commit 9bbe101

Browse files
committed
fix(completion): prevent duplicate in fish shell
1 parent 10fcf46 commit 9bbe101

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

  • crates/vite_global_cli/src/commands/env

crates/vite_global_cli/src/commands/env/setup.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -515,9 +515,12 @@ function vp
515515
end
516516
517517
# Shell completion for fish
518-
set -l __vp_completion "__VP_COMPLETION_FISH__"
519-
if test -f "$__vp_completion"
520-
source "$__vp_completion"
518+
if not set -q __vp_completion_sourced
519+
set -l __vp_completion "__VP_COMPLETION_FISH__"
520+
if test -f "$__vp_completion"
521+
source "$__vp_completion"
522+
set -g __vp_completion_sourced 1
523+
end
521524
end
522525
"#
523526
.replace("__VP_BIN__", &bin_path_ref)

0 commit comments

Comments
 (0)