Single repo + chezmoi status in oh-my-posh prompt

Oh-My-Posh prompt displaying chezmoi status when changes are in working
copy (home dir) and/or uncommitted changes in the source path.

Externals manages as a separate chezmoi source in a subdir of the source
repo.
This commit is contained in:
Gal Szkolnik 2022-09-26 18:39:41 -04:00
parent fed4970b64
commit d6687d8fa4
7 changed files with 110 additions and 8 deletions

View file

@ -1,13 +1,13 @@
if [[ -n "$(which-command chezmoi)" ]]; then
export CZ="$(chezmoi source-path)"
export CZ_X="$CZ.externals"
export CHEZMOIROOT="$CZ"
export CHEZMOIROOT="$(chezmoi source-path)"
export CZ="$CHEZMOIROOT/_home"
export CZ_X="$CHEZMOIROOT/_externals"
alias czcd="cd $CZ"
alias czxcd="cd $CZ_X"
alias cz="chezmoi "
alias czx="chezmoi --source $CZ_X --config $HOME/.config/chezmoi.externals/chezmoi.toml "
alias czx="chezmoi --source $CZ_X --config $HOME/.config/chezmoi/chezmoi.externals.toml "
alias czs="cz status "