solution-rpm/set_versions.sh

26 lines
726 B
Bash
Raw Permalink Normal View History

#!/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