diff options
| author | 魏曹先生 <1992414357@qq.com> | 2025-12-03 16:08:43 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2025-12-03 16:08:43 +0800 |
| commit | 22df30fda5300ec5bb3e1783fe432a696de98d20 (patch) | |
| tree | edac28b04bf117b3462136c78bcbaa9dd84df0ae /scripts/jv_cli.sh | |
| parent | a7b7c8da2989fb2ec6622eabb68c384cd8f4a2c0 (diff) | |
Replace shell glob expansion with built-in glob in entry scripts
- Use `noglob` for Zsh and `set -f` for Bash to disable shell globbing -
Wrap PowerShell aliases in functions to prevent glob expansion -
Maintain existing alias functionality while fixing globbing issues
Diffstat (limited to 'scripts/jv_cli.sh')
| -rw-r--r-- | scripts/jv_cli.sh | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/scripts/jv_cli.sh b/scripts/jv_cli.sh index 09b25ab..1e382d7 100644 --- a/scripts/jv_cli.sh +++ b/scripts/jv_cli.sh @@ -18,10 +18,29 @@ export JV_AUTO_UPDATE=yes ### ALIASES ### ############### +# Disable glob expansion for jv commands across shells +if [ -n "$BASH_VERSION" ]; then # Bash + alias jv='set -f; command jv; set +f' + alias jvt='set -f; command jv track; set +f' + alias jmv='set -f; command jv move; set +f' +elif [ -n "$ZSH_VERSION" ]; then # Zsh + alias jv='noglob jv' + alias jvt='noglob jv track' + alias jmv='noglob jv move' +elif [ -n "$FISH_VERSION" ]; then # Fish + function jv { + command jv $@ + } + function jvt { + command jv track $@ + } + function jmv { + command jv move $@ + } +fi + alias jvh='jv here' alias jvu='jv update' -alias jvt='jv track' -alias jmv='jv move' ################## ### COMPLETION ### |
