From 17ce8c7b31e7d761277016c44fd79a600c87f7e2 Mon Sep 17 00:00:00 2001 From: Mark Ridgwell <273118822+dnyw4l3n13@users.noreply.github.com> Date: Sat, 6 Jun 2026 13:17:14 +0100 Subject: [PATCH] fix: replace raw echo with output helpers in git/make-preview MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated die() to the standard implementation (printf with red ✗ to stderr) and added info() and success() helpers. Replaced the bare echo with info "Using Branch: …" and added a success message on completion. Closes #645 Prompt: Work on issue #645 in credfeto/scripts. Replace raw echo with output helpers in git/make-preview. --- CHANGELOG.md | 1 + git/make-preview | 15 +++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc981183..805d8122 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ Please ADD ALL Changes to the UNRELEASED SECTION and not a specific release - Replace raw echo with standard output helpers (die/info/success) in git/update-repos-personal - GEOIP - Updated GEOIP DB from MaxMind (2026-06-06) - 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 ### Deprecated ### Removed ### Deployment Changes diff --git a/git/make-preview b/git/make-preview index cf5ed119..b1b0ef88 100755 --- a/git/make-preview +++ b/git/make-preview @@ -1,11 +1,18 @@ #! /bin/sh die() { - echo - echo "$@" + 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' "$*" +} + BASEDIR="$(dirname "$(readlink -f "$0")")" # shellcheck source=/dev/null @@ -15,6 +22,6 @@ BASEDIR="$(dirname "$(readlink -f "$0")")" BRANCH="depends/sdk/dotnet/$DOTNET_PREVIEW_VERSION/preview" -echo "Using Branch: $BRANCH" +info "Using Branch: $BRANCH" -git fetch && git checkout main && git pull && git checkout -b "$BRANCH" && git push +git fetch && git checkout main && git pull && git checkout -b "$BRANCH" && git push && success "Branch $BRANCH created and pushed"