Remove stale code functions and update comments

This commit is contained in:
Fabing Li
2025-03-21 02:09:17 +00:00
committed by Tate, Hongliang Tian
parent 501c63893a
commit dd97f016a3

View File

@ -5,8 +5,14 @@
set -e set -e
# This script is used to update Asterinas version numbers in all relevant files in the repository. # This script is used to update Asterinas version numbers in all relevant files in the repository.
# Usage: ./tools/bump_version.sh bump_type # Usage: ./tools/bump_version.sh command [options]
# bump_type can be one of: patch, minor, or major. # Commands:
# --docker_version_file [major|minor|patch|date] Bump the Docker image version in the DOCKER_IMAGE_VERSION file under the project root
# --docker_version_refs Update all references to the Docker image version throughout the codebase
# --version_file Bump the project version to match the Docker image version
# --help, -h Show this help message
# Options:
# major, minor, patch, date The version part to increment when bumping the Docker image version
# TODO: we may remove the VERSION file in the future, # TODO: we may remove the VERSION file in the future,
# and retrieve the current version from git tag. # and retrieve the current version from git tag.
@ -63,42 +69,6 @@ add_one() {
fi fi
} }
# Bump the version based on $bump_type
bump_version() {
local IFS="."
local version_parts=($current_version)
case "$bump_type" in
"patch")
version_parts[2]=$(add_one "${version_parts[2]}")
;;
"minor")
version_parts[1]=$(add_one "${version_parts[1]}")
version_parts[2]=0
;;
"major")
version_parts[0]=$(add_one "${version_parts[0]}")
version_parts[1]=0
version_parts[2]=0
;;
esac
echo "${version_parts[*]}"
}
# Validate the bump type
validate_bump_type() {
case "$bump_type" in
"patch" | "minor" | "major")
;;
*)
echo "Error: Invalid bump_type. Allowed values are: patch, minor, or major."
print_help
exit 1
;;
esac
}
# Update Docker image version in DOCKER_IMAGE_VERSION file # Update Docker image version in DOCKER_IMAGE_VERSION file
update_docker_image_version() { update_docker_image_version() {
local IFS="-" local IFS="-"