| 1 | #!/bin/sh -e |
| 2 | # |
| 3 | # Self-modifying script that updates the version numbers |
| 4 | # |
| 5 | |
| 6 | # The current version goes here, as the default value |
| 7 | VERSION=${1:-'1.7.1'} |
| 8 | |
| 9 | if [ -z "$1" ]; then |
| 10 | echo "The current version is $VERSION, pass the new version as the first argument if you wish to change it" |
| 11 | exit 0 |
| 12 | fi |
| 13 | |
| 14 | echo "Setting the version to $VERSION" |
| 15 | |
| 16 | # Set the version in various files |
| 17 | setconf README.md '* Version' $VERSION |
| 18 | setconf version.go "const VersionString" "\"png2svg "$VERSION"\"" |
| 19 | |
| 20 | # Update the version in this script |
| 21 | sed -i "s/[[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*/$VERSION/g" "$0" |