2022-03-02 05:21:05 -08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# edit the system log located in the docs repo, but also find the docs repo based on what ~/todo points to
|
|
|
|
log() {
|
2022-03-18 17:52:33 -07:00
|
|
|
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
|
2022-03-02 05:21:05 -08:00
|
|
|
}
|