From 5dccb7dc0b3685ce2c2abdb09b0c210f744dc0c2 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Tue, 30 Jan 2024 17:49:31 +0300 Subject: [PATCH] fmt an fix --- update-version.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/update-version.sh b/update-version.sh index d2e5019..2fadb57 100755 --- a/update-version.sh +++ b/update-version.sh @@ -1,4 +1,4 @@ -#/usr/bin/env bash +#!/usr/bin/env bash # This script updates the version number in the README.md files of all modules # to the latest tag in the repository. It is intended to be run from the root @@ -9,13 +9,13 @@ set -euo pipefail LATEST_TAG=$(git describe --abbrev=0 --tags | sed 's/^v//') || exit $? find . -name README.md | while read -r file; do - tmpfile=$(mktemp /tmp/tempfile.XXXXXX) - awk -v tag="$LATEST_TAG" '{ - if ($1 == "version" && $2 == "=") { - sub(/"[^"]*"/, "\"" tag "\"") - print - } else { - print - } - }' "$file" > "$tmpfile" && mv "$tmpfile" "$file" + tmpfile=$(mktemp /tmp/tempfile.XXXXXX) + awk -v tag="$LATEST_TAG" '{ + if ($1 == "version" && $2 == "=") { + sub(/"[^"]*"/, "\"" tag "\"") + print + } else { + print + } + }' "$file" > "$tmpfile" && mv "$tmpfile" "$file" done