chezmoi invocation improvements/fixes
This commit is contained in:
parent
94752b1b5e
commit
b2009f3948
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue