Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Update version on your project using a single command
function updateversion() {
OLD="$1"
NEW="$2"
grep -rl "$OLD" . --exclude-dir={"Build","libs","Pods",".git"} --exclude={"Podfile.lock","CHANGELOG.md","update-version.sh"} | xargs sed -i.bak "s/$OLD/$NEW/g";
find . -type f -name '*.bak' -delete
}
@LeonardoCardoso
Copy link
Author

LeonardoCardoso commented May 14, 2018

Usage: updateversion "1\.0\.0" "1\.0\.1"

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