Shifts the logic into a separate module, will hopefully make it easier to understand repository state.
MAVDUPWDQS4KHMH7THPDZYX53CLT4FTIXBU2DW5G22UTYY5BBWZQC
nu --interactive --execute $'$env.PROMPT_COMMAND = {|| "($prompt_command)"}; enter ($parent_dir); pijul diff -us';
nu --interactive --execute $"enter ($parent_dir); use ($parent_dir | path join repo.nu) repl-prompt; $env.PROMPT_COMMAND = {|| repl-prompt }; pijul diff -us";
export def len-unrecorded [] {
pijul diff -us | lines | length
}
export def repl-prompt [] {
let unrecorded = len-unrecorded;
if ($unrecorded > 1) {
$"(ansi red)($unrecorded) unrecorded changes(ansi reset)"
} else if ($unrecorded == 1) {
$"(ansi red)1 unrecorded change(ansi reset)"
} else {
$"(ansi green)no untracked changes(ansi reset)"
}
}