Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fixed array handling and argument passing in script #310

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mdqst
Copy link

@mdqst mdqst commented Dec 26, 2024

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.

  1. 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.

  2. Safe Argument Passing:
    Another issue I found was with the $@ usage. In the original version, arguments were passed to the cargo publish command 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant