Version v0.2.105 - Test version string replacement

This commit is contained in:
2025-08-31 11:03:02 -04:00
parent 84e2ee5639
commit 7b5db60d80
4 changed files with 36 additions and 371 deletions

View File

@@ -123,9 +123,33 @@ increment_version() {
fi
fi
# Update version strings in source code
update_source_version "$NEW_VERSION"
print_success "Version updated to ${NEW_VERSION}"
}
# Function to update version strings in source code
update_source_version() {
local NEW_VERSION="$1"
print_status "Updating version strings in source code..."
# Replace hardcoded version strings in otp.c with the current git tag
if [ -f "otp.c" ]; then
# Update main menu version
sed -i "s/OTP v[0-9]\+\.[0-9]\+\.[0-9]\+/OTP $NEW_VERSION/g" otp.c
# Update ASCII output version
sed -i "s/Version: v[0-9]\+\.[0-9]\+\.[0-9]\+/Version: $NEW_VERSION/g" otp.c
# Update usage/help text version
sed -i "s/Implementation v[0-9]\+\.[0-9]\+\.[0-9]\+/Implementation $NEW_VERSION/g" otp.c
print_success "Updated version strings in otp.c to $NEW_VERSION"
else
print_warning "otp.c not found - skipping version string updates"
fi
}
# Build functions
build_project() {
print_status "Cleaning previous build..."
@@ -200,28 +224,23 @@ case "${1:-build}" in
uninstall)
uninstall_project
;;
version)
increment_version
print_status "Version tag updated"
;;
*)
echo "OTP Cipher Build Script"
echo "Usage: $0 [-m \"commit message\"] {build|static|clean|install|uninstall|version}"
echo "Usage: $0 [-m \"commit message\"] {build|static|clean|install|uninstall}"
echo ""
echo "Options:"
echo " -m, --message \"text\" - Specify commit message (skips interactive prompt)"
echo ""
echo "Commands:"
echo " build - Build project with automatic version increment (default)"
echo " static - Build with static linking"
echo " static - Build with static linking and version increment"
echo " clean - Clean build artifacts"
echo " install - Install to system (requires build first)"
echo " uninstall - Remove from system"
echo " version - Update version tag only"
echo ""
echo "Examples:"
echo " $0 build"
echo " $0 -m \"Fixed checksum parsing bug\" build"
echo " $0"
echo " $0 -m \"Fixed checksum parsing bug\""
echo " $0 --message \"Added new feature\" static"
exit 1
;;