Skip to content

Instantly share code, notes, and snippets.

@jwerle
Created March 30, 2022 14:34
Show Gist options
  • Save jwerle/5f937115818b76712efca575c73b8a9f to your computer and use it in GitHub Desktop.
Save jwerle/5f937115818b76712efca575c73b8a9f to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
declare -a tags=($(git tag -l))
for tag in "${tags[@]}"; do
## checkout current tag
git checkout "$tag"
## checkout `setup.sh` from master branch with latest changes
git checkout master -- setup.sh
## get current version
declare version="$(bpkg package version)"
## version replacement regex for `sed(1)`
declare regex="s/VERSION=.*/VERSION=\"$version\"/g"
## set versions in files
sed -i "$regex" bpkg.sh
sed -i "$regex" setup.sh
## remove current tag
git tag -d "$tag"
## amend HEAD for current tag
git commit -a --amend --no-edit
## retag
git tag "$tag"
## force push update
git push origin "$tag" -f
done
git checkout master
@jwerle
Copy link
Author

jwerle commented Jun 13, 2022

okay I hope bpkg/bpkg#151 fixes this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment