all repos — doom @ 68612bf7682d757b1aa5eb5d3410e6fdfb98383c

Grab bag of versioned doom files (maps, scripts, notes, etc)

tool(autocommit): check this is a git directory
shwarp
Sun, 30 Aug 2026 15:21:02 -0400
commit

68612bf7682d757b1aa5eb5d3410e6fdfb98383c

parent

8194f3b0d7f7310d1d8c6a1acb080377277ecacc

1 files changed, 9 insertions(+), 0 deletions(-)

jump to
M tools/autocommit → tools/autocommit

@@ -16,12 +16,19 @@ FILE=$(basename "$1")

DIRECTORY=$(echo ${1::-"$((${#FILE} + 1))"}) COMMIT_MESSAGE="auto: $FILE changed" +if [ ! -d "$DIRECTORY/.git" ] || ! git -C "$DIRECTORY" rev-parse 2>/dev/null +then + echo "'${DIRECTORY}' must be an initialised GIT directory" +fi + while true do cd "$DIRECTORY" inotifywait -qq -e CLOSE_WRITE "$FILE" + echo -n ? + # Keep duplicate updates out sleep 1s

@@ -29,6 +36,8 @@ git add "$FILE"

# Bail if nothing to commit git diff --cached --quiet && continue + + echo -ne \\r\\a git commit -qm "$COMMIT_MESSAGE"