-
Notifications
You must be signed in to change notification settings - Fork 112
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
Layered config support #111
Conversation
Now we'll load from all config sources, merging the result. Fixes crate-ci#93
Not supporting `workspace_root/Cargo.toml` since a comment states it is deprecated.
OsStr::new("NEW_VERSION") => new_version_string.as_ref(), | ||
OsStr::new("DRY_RUN") => OsStr::new(if dry_run { "true" } else { "false" }), | ||
OsStr::new("WORKSPACE_ROOT") => ws_meta.workspace_root.as_os_str(), | ||
OsStr::new("CRATE_ROOT") => manifest_path.parent().unwrap_or_else(|| Path::new(".")).as_os_str(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to add some tests to make sure this actually is useful for the various use cases.
I suspect it won't be and that we'll need to do replacements on the hook to allow it to be shared.
I decided against tracking the directory that defines the hook and setting the CWD to simplify the merging process.
Includes loading a workspace-wide config. To make hooks still work, this also adds environment variables to access the workspace and crate paths.
Fixes #93