diff --git a/CHANGELOG.md b/CHANGELOG.md index cc183b89..5ccaa8a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ Please ADD ALL Changes to the UNRELEASED SECTION and not a specific release - Replace raw echo with output helpers (die, info, success) in git/missing-release-branches - git/make-preview: replaced raw echo with die/info/success output helpers - GEOIP - Updated GEOIP DB from MaxMind (2026-06-12) +- Replaced raw echo with output helpers (die/info/success) in git/clean-all ### Deprecated ### Removed ### Deployment Changes diff --git a/git/clean-all b/git/clean-all index 5c857bae..ab2e3d59 100755 --- a/git/clean-all +++ b/git/clean-all @@ -1,14 +1,27 @@ #! /bin/sh + +die() { + printf '\n\033[31m✗\033[0m %s\n' "$*" >&2 + exit 1 +} + +success() { + printf '\n\033[32m✓\033[0m %s\n' "$*" +} + +info() { + printf '\n\033[32m→\033[0m %s\n' "$*" +} + find "$(pwd)"/* -name '*.git' -print | sed "s|/.git$||" | sort -u | grep -v .cache | while IFS= read -r line do - echo "$line" + info "$line" CURRENT_DIR=$line - echo "" - echo "Retrieving $CURRENT_DIR..." + info "Retrieving $CURRENT_DIR..." git -C "$CURRENT_DIR" remote get-url origin 2>&1 git -C "$CURRENT_DIR" clean -f -d -x 2>&1 git -C "$CURRENT_DIR" remote update origin --prune 2>&1 - echo " * done" + success "Done." done