Created
September 25, 2019 10:14
-
-
Save thbkrkr/60c3c4cf163c277fdc405c477ad407bf to your computer and use it in GitHub Desktop.
Bump version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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