chezmoi invocation improvements/fixes

This commit is contained in:
Lockszmith (wsl@Sygin) 2025-04-09 21:32:21 -04:00
parent 94752b1b5e
commit b2009f3948
1 changed files with 3 additions and 4 deletions

View File

@ -15,11 +15,10 @@ if is_cmd 'chezmoi'; then
chezmoi() { chezmoi() {
${SET_X:-:} -x ${SET_X:-:} -x
local _args=()
[ $# -ge 2 ] && _args=("${@:2}")
case "$1" in case "$1" in
"cd") cd "$(command chezmoi source-path "${_args[@]}")" ;; "cd") cd "$(chezmoi source-path "${@:2}")" ;;
"edit") ${VISUAL:-${EDITOR:-vi}} $(command chezmoi sourch-path "${_args[@]}") ;; "edit") ${VISUAL:-${EDITOR:-vi}} $(chezmoi source-path "${@:2}") ;;
"source-path") printf '%s\n' "${@:2}" | xargs -r chezmoi source-path ;;
*) command chezmoi "${@}" ;; *) command chezmoi "${@}" ;;
esac esac
${SET_X:-:} +x ${SET_X:-:} +x