version_set.sh 649 B

12345678910111213141516171819202122232425262728
  1. #!/bin/sh
  2. # A script to set version number to $1
  3. # Example: ./version_set.sh 0.1
  4. # Current version number
  5. current_version=$(cat ./VERSION)
  6. # New, wanted one
  7. new_version=$1
  8. # Print what will be done
  9. echo "Put" $new_version "instead of" $current_version
  10. # Replace in the 4 files : VERSION, _oasis, src/oclaunch.ml, opam
  11. echo $new_version > VERSION
  12. sed -i -e "s/Version: .*/Version: $new_version/" _oasis
  13. sed -i -e "s/\\(let version_number = \"\\).*\\(\";;\\)/\\1$new_version\\2/" src/oclaunch.ml
  14. sed -i -e "s/^version: \".*\"$/version: \"$new_version\"/" opam
  15. # Update oasis
  16. oasis setup
  17. # Display the result
  18. echo "Result"
  19. git diff -U0