diff --git a/dot_local/bin/executable_sysjournal b/dot_local/bin/executable_sysjournal index 0ccd3f6..9043962 100755 --- a/dot_local/bin/executable_sysjournal +++ b/dot_local/bin/executable_sysjournal @@ -14,7 +14,20 @@ set -euo pipefail -VAULT="${SYSJOURNAL_VAULT:-$HOME/Documents/Obsidian25}" +# Vault location. SYSJOURNAL_VAULT always wins; otherwise take the first +# candidate that exists on this machine. Obsidian-Personal is the cutover +# target, so it is preferred wherever it has landed; the pre-split vault is +# the fallback for machines that have not synced the split yet, and it is +# named Obsidian25 on Linux but Obsidian2 on the MacBook. +sysjournal_default_vault() { + local c + for c in "Obsidian-Personal" "Obsidian25" "Obsidian2"; do + [ -d "$HOME/Documents/$c" ] && { printf '%s' "$HOME/Documents/$c"; return; } + done + printf '%s' "$HOME/Documents/Obsidian-Personal" # for the error message +} + +VAULT="${SYSJOURNAL_VAULT:-$(sysjournal_default_vault)}" SUBDIR="${SYSJOURNAL_SUBDIR:-Tech/Infrastructure}" INFRA="$VAULT/$SUBDIR"