diff --git a/set_versions.sh b/set_versions.sh new file mode 100755 index 0000000..df1e4bc --- /dev/null +++ b/set_versions.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# Currently not used + +$name=SolutionTM +$version=0.1.0 + +# If git is unclean, exit +if ! git diff-index --quiet HEAD --; then + echo "Git is unclean. Please commit your changes before building the RPM package." + exit 1 +fi + +# These should all set the first occurrence of the +# version number in the respective files. + +# Set the version number in the spec file. +sed -i "0,/Version: .*/s/Version: .*/Version: $version/" $name.spec + +# Set the version number in the Cargo.toml file. +sed -i "0,/version = \".*\"/s/version = \".*\"/version = \"$version\"/" Cargo.toml + +# Set the version number in the Cargo.lock file. +sed -i "0,/version = \".*\"/s/version = \".*\"/version = \"$version\"/" Cargo.lock + +git diff \ No newline at end of file