script to check version
This commit is contained in:
parent
6e80373979
commit
b0a1c78384
1 changed files with 34 additions and 0 deletions
34
install/chores/check_version
Executable file
34
install/chores/check_version
Executable file
|
@ -0,0 +1,34 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
script="$( readlink -f "${0}" )"
|
||||||
|
script_dir="$( dirname "${script}" )"
|
||||||
|
|
||||||
|
git_version="$( \
|
||||||
|
git rev-parse --abbrev-ref HEAD \
|
||||||
|
| cut -d '/' -f 2
|
||||||
|
)"
|
||||||
|
|
||||||
|
api_version="$( \
|
||||||
|
grep '^version' "${script_dir}/../../api/pyproject.toml" \
|
||||||
|
| sed -E 's/^version[^0-9]*((0|[1-9][0-9]*)[0-9\.]*[0-9]).*$/\1/'
|
||||||
|
)"
|
||||||
|
|
||||||
|
ui_version="$( \
|
||||||
|
python3 -c 'import sys, json; print(json.load(sys.stdin)["version"])' \
|
||||||
|
< "${script_dir}/../../ui/package.json" \
|
||||||
|
)"
|
||||||
|
|
||||||
|
install_version="$( \
|
||||||
|
grep '^ovd_version' "${script_dir}/../install.sh" \
|
||||||
|
| sed -E 's/^ovd_version[^0-9]*((0|[1-9][0-9]*)[0-9\.]*[0-9]).*$/\1/'
|
||||||
|
)"
|
||||||
|
|
||||||
|
if [ "${git_version}" = "${api_version}" ] \
|
||||||
|
&& [ "${git_version}" = "${ui_version}" ] \
|
||||||
|
&& [ "${git_version}" = "${install_version}" ]; then
|
||||||
|
mark="✅️"
|
||||||
|
else
|
||||||
|
mark="❌️"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "git: ${git_version}, api: ${api_version}, ui: ${ui_version}, installer: ${install_version} ${mark}"
|
Loading…
Reference in a new issue