Skip to content

Instantly share code, notes, and snippets.

@thbkrkr
Created September 25, 2019 10:14
Show Gist options
  • Save thbkrkr/60c3c4cf163c277fdc405c477ad407bf to your computer and use it in GitHub Desktop.
Save thbkrkr/60c3c4cf163c277fdc405c477ad407bf to your computer and use it in GitHub Desktop.
Bump version
#!/bin/bash
set -euo pipefail
#
# Bump version
#
old=v1alpha1
new=v1beta1
replace() {
for target in "pkg config test docs"; do
find $target -type f | xargs -n1 sed -i "s|$old|$new|g"
done
}
rename() {
while read x; do
mv $x $(sed "s|$old|$new|" <<< $x)
done < <(find . -name "*$old*" -not -path "./vendor/*" -not -path "./.git/*")
}
replace
rename
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment