fix: format_version_number fonction

This commit is contained in:
Garnajee 2024-06-06 11:15:05 +02:00
parent ec3784e9ca
commit a0ab3c59a3

View File

@ -14,7 +14,12 @@ get_current_transmission_version() {
format_version_number() {
version=$1
formatted_version=$(echo $version | tr -d '.') # Remove dots
printf "%04d" $formatted_version # Ensure it has 4 digits
length=${#formatted_version} # Get the length of the formatted version
if [ $length -eq 3 ]; then
echo "${formatted_version}0" # Append zero if length is 3
else
echo "$formatted_version" # Otherwise, return the formatted version as is
fi
}
# Check if update is needed