fix: Fixed array handling and argument passing in script
Description:
I noticed a couple of potential issues in the script that could lead to unexpected behavior, especially when dealing with spaces or special characters in directory names or script arguments.
-
Array Handling:
In the original script, the array was defined as:ORDER=(ethabi derive contract cli)While this works in most cases, it can cause issues if any of the array elements contain spaces or special characters. I updated this to:
ORDER=("ethabi" "derive" "contract" "cli")This ensures each element is treated as a distinct array item, even when it includes spaces or special characters.
-
Safe Argument Passing:
Another issue I found was with the$@usage. In the original version, arguments were passed to thecargo publishcommand like this:cargo publish $@Without quotes around
$@, any arguments containing spaces or special characters could be misinterpreted. I fixed it by adding quotes:cargo publish "$@"This change ensures that all arguments are passed correctly to the command, regardless of their content.
These adjustments should make the script more robust and prevent potential issues when dealing with various file and argument formats.