update-readmes.sh 628 B

1234567891011121314151617181920212223
  1. #!/bin/sh
  2. # Needs gnu-sed on macOS for inplace replacement
  3. # brew install --with-default-names gnu-sed
  4. set -e
  5. if [ -z "$1" ]
  6. then
  7. echo "Usage: ./update-readmes.sh <from-branch> <to-branch>"
  8. echo "Example: ./update-readmes.sh 3.6 3.7"
  9. exit
  10. fi
  11. if [ -z "$2" ]
  12. then
  13. echo "Usage: ./update-readmes.sh <from-branch> <to-branch>"
  14. echo "Example: ./update-readmes.sh 3.6 3.7"
  15. exit
  16. fi
  17. find . -type f -name 'README.md' | while read line; do
  18. echo "Updating $line"
  19. sed -i "s,https://github.com/EsotericSoftware/spine-runtimes/archive/$1.zip,https://github.com/EsotericSoftware/spine-runtimes/archive/$2.zip,g" $line
  20. done