You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

update_version.sh 525B

12345678910111213141516
  1. # update RAGFlow version
  2. # Get the latest tag
  3. last_tag=$(git describe --tags --abbrev=0)
  4. # Get the number of commits from the last tag
  5. commit_count=$(git rev-list --count "$last_tag..HEAD")
  6. # Get the short commit id
  7. last_commit=$(git rev-parse --short HEAD)
  8. version_info=""
  9. if [ "$commit_count" -eq 0 ]; then
  10. version_info=$last_tag
  11. else
  12. printf -v version_info "%s(%s~%d)" "$last_commit" "$last_tag" $commit_count
  13. fi
  14. # Replace the version in the versions.py file
  15. sed -i "s/\"dev\"/\"$version_info\"/" api/versions.py