fix: Improved version update script with argument validation and cros… #6742
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This update improves the version change script by implementing several important fixes:
Argument validation: Added a check to ensure the script receives exactly two arguments (current and new version), preventing errors when running the script without the required inputs.
Quoting variable expansions: Ensured all variables (like
$1
,$FROM
, and$TO
) are quoted to prevent issues when the values contain spaces or special characters.Cross-platform compatibility: Updated the
sed
command to handle in-place editing across different platforms, ensuring compatibility with both Linux and macOS.These changes make the script more robust, reliable, and easier to use across different environments.