Skip to content

Commit

Permalink
20240528
Browse files Browse the repository at this point in the history
- Try to fix #24 and https://t.me/XZG_FW/17/804
- Fix wrong version apply cause of time difference
- Add version file update if tag need suffix
  • Loading branch information
xyzroe committed May 27, 2024
1 parent b980a62 commit c22097f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
11 changes: 5 additions & 6 deletions tools/build/version_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,13 @@ def write_version_to_file(file_path, version):
if not os.path.exists(PROJECT_DIR + os.sep + "include"):
os.mkdir(PROJECT_DIR + os.sep + "include")
VERSION_HEADER = "include" + os.sep + VERSION_HEADER

current_version = read_version_from_file(VERSION_HEADER)

if current_version:
if current_version.startswith(current_date):
new_version = current_version
else:
new_version = current_date
if current_version is None:
new_version = current_date
elif current_version.startswith(current_date) or current_version > current_date:
new_version = current_version
else:
new_version = current_date

Expand Down
6 changes: 5 additions & 1 deletion tools/commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ while git rev-parse "$tag" >/dev/null 2>&1; do
tag="${base}.${suffix}"
done

echo $tag
sed -i.bak "s/#define VERSION \"${version}\"/#define VERSION \"${tag}\"/" "$VERSION_HEADER"

rm "${VERSION_HEADER}.bak"

echo "Updated version to $tag in $VERSION_HEADER"

# Checking for commit message file
if [ -f "$COMMIT_MESSAGE_FILE" ]; then
Expand Down

0 comments on commit c22097f

Please sign in to comment.