how-to-package-rpms/update-version.sh
2025-01-06 19:00:20 -06:00

14 lines
405 B
Bash
Executable file

#!/usr/bin/env bash
# This is just a script to update the Version in `polycat.spec`
set -ex
DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
cd $DIR
git clone https://github.com/2IMT/polycat.git
cd polycat/
VERSION=$(printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)")
cd ..
rm -rf polycat/
sed -i "s/Version:.*/Version: $VERSION/g" polycat.spec