From bd8c92f28ca8adddcdc100829f6f26f91609be6a Mon Sep 17 00:00:00 2001 From: Joseph Werle Date: Tue, 14 Jun 2022 12:12:27 +0200 Subject: [PATCH] chore(scripts): add 'update-version.sh' script --- scripts/update-versions.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 scripts/update-versions.sh diff --git a/scripts/update-versions.sh b/scripts/update-versions.sh new file mode 100755 index 0000000..925d9ea --- /dev/null +++ b/scripts/update-versions.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +declare shell_targets=(setup.sh bpkg.sh) +declare json_targets=(bpkg.json) +declare latest="$(git describe --tags --abbrev=0)" + +for target in "${shell_targets[@]}"; do + sed -i "s/VERSION=.*/VERSION=\"$latest\"/g" "$target" +done + +for target in "${json_targets[@]}"; do + sed -i "s/\"version\"\s*:\s*\".*\",/\"version\": \"$latest\",/g" "$target" +done