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: correct shell substitution in installer #9351

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

mdqst
Copy link
Contributor

@mdqst mdqst commented Nov 19, 2024

Description:
This pull request addresses a small issue in the script where there was a typographical error in the line:

FOUNDRY_DIR="${FOUNDRY_DIR-"$BASE_DIR/.foundry"}"

The correct syntax for setting a default value using parameter expansion should be:

FOUNDRY_DIR="${FOUNDRY_DIR:-"$BASE_DIR/.foundry"}"

Importance:

  • The original code incorrectly used {" instead of :-, which is the correct syntax for default value assignment in Bash parameter expansion.
  • This error would prevent the script from correctly setting the FOUNDRY_DIR variable if it wasn't previously defined.
  • The fix ensures that if FOUNDRY_DIR is not set, it will default to "$BASE_DIR/.foundry", which is the intended behavior.

By correcting this, the script now functions as expected, ensuring proper assignment of the FOUNDRY_DIR variable and avoiding potential issues in its execution.

Fix typographical error in default value assignment for FOUNDRY_DIR
Copy link
Member

@DaniPopes DaniPopes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They're both correct, but :- also substitutes if the variable is empty (""). Thanks!

@DaniPopes DaniPopes enabled auto-merge (squash) November 19, 2024 15:16
@DaniPopes DaniPopes changed the title Typo Update install fix: correct shell substitution in installer Nov 19, 2024
@DaniPopes DaniPopes enabled auto-merge (squash) November 19, 2024 15:17
@DaniPopes DaniPopes merged commit d20c142 into foundry-rs:master Nov 20, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants