1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00
lvgl/scripts/find_version.sh
Marex 9343212415
fix(docs): pull version out of lv_version.h (#6097)
Signed-off-by: Marek Vasut <marex@denx.de>
Co-authored-by: Marek Vasut <marex@denx.de>
2024-04-22 16:44:55 +02:00

9 lines
363 B
Bash
Executable File

#!/bin/bash
# Credit: https://stackoverflow.com/a/4774063
SCRIPTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
TMPENVFILE=$(mktemp /tmp/lvgl.script.XXXXXX)
cat $SCRIPTPATH/../lv_version.h | grep "#define LVGL_VERSION_" | sed 's/#define //g' | sed -r 's/\s+/=/' > $TMPENVFILE
. $TMPENVFILE
rm $TMPENVFILE
echo $LVGL_VERSION_MAJOR.$LVGL_VERSION_MINOR