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