feat: suppress pixi release notes by default (#1225)
Co-authored-by: Gideon <87426140+GideonBear@users.noreply.github.com>
This commit is contained in:
@@ -590,14 +590,21 @@ pub fn run_pixi_update(ctx: &ExecutionContext) -> Result<()> {
|
||||
|
||||
// Check if `pixi --help` mentions self-update, if yes, self-update must be enabled.
|
||||
// pixi self-update --help works regardless of whether the feature is enabled.
|
||||
let output = ctx.run_type().execute(&pixi).arg("--help").output_checked()?;
|
||||
let top_level_help_output = ctx.run_type().execute(&pixi).arg("--help").output_checked_utf8()?;
|
||||
|
||||
if String::from_utf8(output.stdout)?.contains("self-update") {
|
||||
ctx.run_type()
|
||||
if top_level_help_output.stdout.contains("self-update") {
|
||||
let self_update_help_output = ctx
|
||||
.run_type()
|
||||
.execute(&pixi)
|
||||
.args(["self-update"])
|
||||
.status_checked()
|
||||
.ok();
|
||||
.args(["self-update", "--help"])
|
||||
.output_checked_utf8()?;
|
||||
let mut cmd = ctx.run_type().execute(&pixi);
|
||||
cmd.arg("self-update");
|
||||
// check if help mentions --no-release-note to check if it is supported
|
||||
if self_update_help_output.stdout.contains("--no-release-note") && !ctx.config().show_pixi_release_notes() {
|
||||
cmd.arg("--no-release-note");
|
||||
}
|
||||
cmd.status_checked()?;
|
||||
}
|
||||
|
||||
ctx.run_type()
|
||||
|
||||
Reference in New Issue
Block a user