kiwi-scp/bump-version.sh

12 lines
410 B
Bash
Executable file

#!/bin/bash
this="$(readlink -f "${0}")"
this_dir="$(dirname "${this}")"
git_branch="$(git rev-parse --abbrev-ref HEAD)"
git_tag="$(git describe --abbrev=0)"
version_str="${git_branch##*/}"
echo "${version_str}" > "${this_dir}/src/etc/version_tag"
sed -ri "s/(version\s*:).*$/\1 '${version_str}'/" "${this_dir}/example/kiwi.yml"
sed -ri "s/(version\s*=\s*).*$/\1\"${version_str}\",/" "${this_dir}/setup.py"