Skip to content

Instantly share code, notes, and snippets.

@LeonardoCardoso
Created May 14, 2018 09:46
Show Gist options
  • Save LeonardoCardoso/bba645d3ffbdb3f52c64bbc7cf8fa70f to your computer and use it in GitHub Desktop.
Save LeonardoCardoso/bba645d3ffbdb3f52c64bbc7cf8fa70f to your computer and use it in GitHub Desktop.
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

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