1
0
Fork 0
mirror of https://github.com/polybar/polybar.git synced 2024-11-11 13:50:56 -05:00
polybar/version.sh

26 lines
463 B
Bash
Raw Normal View History

2016-06-28 08:50:21 -04:00
#!/bin/sh
msg() {
echo " \033[1;32m**\033[0m" "$@"
}
main() {
2016-06-28 09:24:23 -04:00
version="$1"
[ "$version" ] || {
version="$(git describe --tags --dirty=-dev)"
}
2016-06-28 08:50:21 -04:00
msg "Current version: ${version}"
sed -r "/#define GIT_TAG/s/GIT_TAG .*/GIT_TAG \"${version}\"/" -i include/version.hpp
if [ "$(git diff include/version.hpp 2>/dev/null)" ]; then
msg "Updated include/version.hpp"
else
msg "<include/version.hpp> is already up-to-date"
fi
}
main "$@"