fix: validate --app-config path early with clear error#77
Open
nanookclaw wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #42.
When an invalid
--app-config(orNEMO_APP_CONFIG) path is passed, the failure currently surfaces deep in the loading pipeline as a generic IO error. This adds a targeted check incrates/nemo/src/main.rsright afterArgs::parse(), beforeruntime::NemoRuntime::new(...)and the GPUI early-runtime path, so the user sees what they actually passed.Behavior:
std::env::current_dir()for theexists/is_filechecks. Ifcurrent_dir()fails the path is checked as supplied — the not-found error then reports the original path the user passed, never a canonicalized variant.Error: config file not found: <path>Error: config path is not a file: <path>std::process::exit(1).The existing
if let Some(ref app_config) = args.app_config { ... headless/validate ... }block is left intact; the new block is additive and only changes behavior for paths that would have failed anyway.Verified with
cargo check -p nemoandcargo clippy -p nemo --no-deps(clean).