fix(scripts/git-tag-history): check for diff before modifying

pull/152/head
Joseph Werle 2 years ago
parent c28f420581
commit 6cdcebb9d4

@ -15,14 +15,17 @@ for tag in "${tags[@]}"; do
## set versions in files ## set versions in files
sed -i "$regex" bpkg.sh sed -i "$regex" bpkg.sh
sed -i "$regex" setup.sh sed -i "$regex" setup.sh
## remove current tag
git tag -d "$tag" if ! git diff --exit-code; then
## amend HEAD for current tag ## remove current tag
git commit -a --amend --no-edit git tag -d "$tag"
## retag ## amend HEAD for current tag
git tag "$tag" git commit -a --amend --no-edit
## force push update ## retag
git push origin "$tag" -f git tag "$tag"
## force push update
git push origin "$tag" -f
fi
done done
git checkout master git checkout master

Loading…
Cancel
Save