Skip to content

Commit

Permalink
Scripts: fix a bug
Browse files Browse the repository at this point in the history
Modified the matching method for version info in the format of x.x.x_yyyy-mm-dd. And optimized the code format.
Signed-off-by: Jianhang Wu <[email protected]>
  • Loading branch information
Jianhang Wu committed Jan 13, 2025
1 parent 24fb413 commit 043cab0
Show file tree
Hide file tree
Showing 3 changed files with 268 additions and 200 deletions.
7 changes: 4 additions & 3 deletions scripts/envsetup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1471,9 +1471,10 @@ function build_rv_firmware_bin()

if [ ! -e "$RELEASED_NOTE_MD" ] || [ ! -s "$RELEASED_NOTE_MD" ];then
version="1.0.0"
else
cp $RELEASED_NOTE_MD $RV_FIRMWARE_INSTALL_DIR/
version=$(awk 'END {split($1, a, "_"); print a[1]}' $RELEASED_NOTE_MD)
else
cp $RELEASED_NOTE_MD $RV_FIRMWARE_INSTALL_DIR/
LAST_MATCH=$(grep -iE '[0-9]+\.[0-9]+\.[0-9]+_[0-9]{4}-[0-9]{2}-[0-9]{2}' "$RELEASED_NOTE_MD" | tail -n 1)
version=$(echo "$LAST_MATCH" | cut -d'_' -f1)
fi

pushd $RV_FIRMWARE_INSTALL_DIR
Expand Down
Loading

0 comments on commit 043cab0

Please sign in to comment.