log: big changes, more to come

This commit is contained in:
PowerUser64 2022-03-18 17:52:33 -07:00
parent 990f4cd542
commit b0d9876558

View file

@ -2,5 +2,14 @@
# edit the system log located in the docs repo, but also find the docs repo based on what ~/todo points to
log() {
$EDITOR "$(git -C "$(dirname "$(realpath ~/todo)")" rev-parse --show-toplevel)/system-log"
DOCS_REPO="${DOCS_REPO:-$(git -C "$(dirname "$(realpath ~/todo)")" rev-parse --show-toplevel)}"
LOG_FILE=system-log
LOG_FILE_PATH="$DOCS_REPO/$LOG_FILE"
if git -C "$DOCS_REPO" pull; then
$EDITOR "$LOG_FILE_PATH"
git -C "$DOCS_REPO" commit -m "$LOG_FILE" "$LOG_FILE_PATH"
else
$EDITOR "$LOG_FILE_PATH"
fi
}