File tree Expand file tree Collapse file tree
crates/vite_global_cli/src/commands/env Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -449,13 +449,15 @@ if [ -n "$BASH_VERSION" ] && type complete >/dev/null 2>&1; then
449449 eval "$(VP_COMPLETE=bash command vp)"
450450elif [ -n "$ZSH_VERSION" ] && type compdef >/dev/null 2>&1; then
451451 eval "$(VP_COMPLETE=zsh command vp)"
452+ eval '
452453 _vpr_complete() {
453454 local -a orig=("${words[@]}")
454455 words=("vp" "run" "${orig[@]:1}")
455456 CURRENT=$((CURRENT + 1))
456457 ${=_comps[vp]}
457458 }
458459 compdef _vpr_complete vpr
460+ '
459461fi
460462"#
461463 . replace ( "__VP_BIN__" , & bin_path_ref) ;
@@ -918,6 +920,10 @@ mod tests {
918920 env_content. contains( "compdef _vpr_complete vpr" ) ,
919921 "env should have vpr completion for zsh"
920922 ) ;
923+ assert ! (
924+ env_content. contains( "eval '" ) && env_content. contains( "_vpr_complete() {" ) ,
925+ "env should wrap zsh-specific code in eval"
926+ ) ;
921927 assert ! ( fish_content. contains( "complete -c vpr" ) , "env.fish should have vpr completion" ) ;
922928 assert ! (
923929 ps1_content. contains( "Register-ArgumentCompleter -Native -CommandName vpr" ) ,
You can’t perform that action at this time.
0 commit comments