-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add Workspace::is_install
to detect cargo install
#10966
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -561,6 +561,13 @@ impl<'cfg> Workspace<'cfg> { | |
self.member_ids.contains(&pkg.package_id()) | ||
} | ||
|
||
/// Returns true if this workspace is being used for a `cargo install` operation | ||
pub fn is_install(&self) -> bool { | ||
// For now, this condition detects `cargo install`, but calling `is_install` allows us to | ||
// more easily change that in the future. | ||
self.is_ephemeral && self.ignore_lock | ||
Comment on lines
+565
to
+568
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, good point. I did this based on inspiration from #10891 (comment) . @ehuss, is there a variant of this that would make that code clearer, or should I just drop this change? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think there is a good way to detect if it is an I think it might be ok to add something to I wouldn't make this a property of the workspace. I forgot to also say that |
||
} | ||
|
||
pub fn is_ephemeral(&self) -> bool { | ||
self.is_ephemeral | ||
} | ||
|
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.