Currently unused set_versions.sh script

This commit is contained in:
Imbus 2024-06-10 12:09:24 +02:00
parent 3b63d4fe6b
commit a262510dc7

26
set_versions.sh Executable file
View file

@ -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