czu does some stuff for me now
This commit is contained in:
parent
9ecb3f4910
commit
9ec99b9d7f
|
@ -50,7 +50,36 @@ if is_cmd 'chezmoi'; then
|
||||||
# externals yaml is performed.
|
# externals yaml is performed.
|
||||||
alias czx="CZ_EXTR=1 chezmoi "
|
alias czx="CZ_EXTR=1 chezmoi "
|
||||||
|
|
||||||
alias czu="czg pull && cz init --verbose && cz apply --verbose && _r"
|
function czu() {
|
||||||
|
local all=0 refresh=1 verbose='--verbose' debug='' prompts='--promptDefaults'
|
||||||
|
while [[ $# -gt 0 ]]; do
|
||||||
|
case "$1" in
|
||||||
|
'--all') all=1 ;;
|
||||||
|
'--prompt') prompts='' ;;
|
||||||
|
'--no-refresh') refresh=0 ;;
|
||||||
|
'--quiet') verbose='' ;;
|
||||||
|
'--debug') debug='--debug' ;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
if [[ $all -eq 1 ]]; then
|
||||||
|
chezmoi upgrade
|
||||||
|
fi
|
||||||
|
chezmoi git -- pull --autostash --rebase \
|
||||||
|
&& chezmoi init $prompts $verbose $debug \
|
||||||
|
&& chezmoi status $verbose $debug \
|
||||||
|
&& chezmoi apply --interactive --verbose $verbose $debug
|
||||||
|
|
||||||
|
if [[ $all -eq 1 ]]; then
|
||||||
|
CZ_EXTR=1
|
||||||
|
CZ_EZA_PREFIX=""
|
||||||
|
chezmoi status $verbose $debug \
|
||||||
|
|| (CZ_EZA_PREFIX='./' && chezmoi status $verbose $debug ) && chezmoi apply $verbose $debug
|
||||||
|
fi
|
||||||
|
|
||||||
|
[[ $refresh -ne 1 ]] || (printf "restarting shell...\n" >&2 || exec $SHELL -l)
|
||||||
|
|
||||||
|
}
|
||||||
alias czxu="cz upgrade && czg pull && cz init --verbose && czx apply --verbose && _r"
|
alias czxu="cz upgrade && czg pull && cz init --verbose && czx apply --verbose && _r"
|
||||||
alias cz-reset-home="(czgcd && cd chezmoi.roots && RESET=reset SRC_DIR=_src.all ./symclone.sh _home && RESET=reset ./symclone.sh _home.macos)"
|
alias cz-reset-home="(czgcd && cd chezmoi.roots && RESET=reset SRC_DIR=_src.all ./symclone.sh _home && RESET=reset ./symclone.sh _home.macos)"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue