Skip to content

fix(cli): avoid panic on invalid remappings env and validate config path#13660

Open
edgarr1986 wants to merge 2 commits intofoundry-rs:masterfrom
edgarr1986:fix-cli-remappings-env-config-path
Open

fix(cli): avoid panic on invalid remappings env and validate config path#13660
edgarr1986 wants to merge 2 commits intofoundry-rs:masterfrom
edgarr1986:fix-cli-remappings-env-config-path

Conversation

@edgarr1986
Copy link
Contributor

@edgarr1986 edgarr1986 commented Mar 7, 2026

Invalid remappings env inputs now produce a warning instead of a panic

Copy link
Member

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

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

in the future I would recommend splitting PRs more. for example, the remapping change looks good to me in this PR, but the config path validation does not. had it been split we could merge the remappings fix without blocking on the latter:)

return Err(format!("config-path `{}` does not exist", path.display()));
}
if path.file_name() != Some(OsStr::new(Config::FILE_NAME)) {
return Err("the config-path must be a path to a foundry.toml file".to_string());
Copy link
Member

Choose a reason for hiding this comment

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

we should not enforce the file name. if you specify --config-path, it's perfectly valid to point to e.g. foundry.dev.toml or foundry.example.toml or whatever else you want

Copy link
Contributor Author

@edgarr1986 edgarr1986 Mar 10, 2026

Choose a reason for hiding this comment

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

@onbjerg Updated as requested, thanks for your time!

@zerosnacks zerosnacks requested a review from onbjerg March 10, 2026 10:55
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