Guest User

Untitled

a guest
Jun 13th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. set -eof pipefail
  4.  
  5. usage() {
  6. printf "%s is a tool for upgrading status-go to a given version.\n" "$(basename "$0")"
  7. printf "The given version must be uploaded to Artifactory first.\n\n"
  8. printf "Usage:\n\n"
  9. printf " %s version\n\n" "$(basename "$0")"
  10. printf "Example:\n\n"
  11. printf " %s develop-g12345678\n" "$(basename "$0")"
  12. }
  13.  
  14. sedi () {
  15. sed --version >/dev/null 2>&1 && sed -i -- "$@" || sed -i "" "$@"
  16. }
  17.  
  18. if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
  19. usage
  20. exit 1
  21. fi
  22.  
  23. if [ $# -eq 0 ]; then
  24. echo "Need to provide a status-go version"
  25. exit 1
  26. fi
  27.  
  28. STATUSGO_VERSION=$1
  29.  
  30. sedi "s/\(<version>\).*\(<\/version>\)/\1$STATUSGO_VERSION\2/" modules/react-native-status/ios/RCTStatus/pom.xml
  31. sedi "s/\(statusGoVersion = '\).*\('\)/\1$STATUSGO_VERSION\2/" modules/react-native-status/android/build.gradle
Add Comment
Please, Sign In to add comment