feat: suppress pixi release notes by default (#1225)
Co-authored-by: Gideon <87426140+GideonBear@users.noreply.github.com>
This commit is contained in:
@@ -325,3 +325,9 @@
|
|||||||
# extensions should be updated for.
|
# extensions should be updated for.
|
||||||
# (default: this won't be set by default)
|
# (default: this won't be set by default)
|
||||||
# profile = ""
|
# profile = ""
|
||||||
|
|
||||||
|
[pixi]
|
||||||
|
# Show the release notes of the latest pixi release
|
||||||
|
# during the pixi step
|
||||||
|
# (default: false)
|
||||||
|
# include_release_notes = false
|
||||||
|
|||||||
@@ -301,6 +301,13 @@ pub struct Flatpak {
|
|||||||
use_sudo: Option<bool>,
|
use_sudo: Option<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Deserialize, Default, Debug, Merge)]
|
||||||
|
#[serde(deny_unknown_fields)]
|
||||||
|
#[allow(clippy::upper_case_acronyms)]
|
||||||
|
pub struct Pixi {
|
||||||
|
include_release_notes: Option<bool>,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Default, Debug, Merge)]
|
#[derive(Deserialize, Default, Debug, Merge)]
|
||||||
#[serde(deny_unknown_fields)]
|
#[serde(deny_unknown_fields)]
|
||||||
pub struct Brew {
|
pub struct Brew {
|
||||||
@@ -560,6 +567,9 @@ pub struct ConfigFile {
|
|||||||
#[merge(strategy = crate::utils::merge_strategies::inner_merge_opt)]
|
#[merge(strategy = crate::utils::merge_strategies::inner_merge_opt)]
|
||||||
flatpak: Option<Flatpak>,
|
flatpak: Option<Flatpak>,
|
||||||
|
|
||||||
|
#[merge(strategy = crate::utils::merge_strategies::inner_merge_opt)]
|
||||||
|
pixi: Option<Pixi>,
|
||||||
|
|
||||||
#[merge(strategy = crate::utils::merge_strategies::inner_merge_opt)]
|
#[merge(strategy = crate::utils::merge_strategies::inner_merge_opt)]
|
||||||
distrobox: Option<Distrobox>,
|
distrobox: Option<Distrobox>,
|
||||||
|
|
||||||
@@ -1345,6 +1355,15 @@ impl Config {
|
|||||||
.unwrap_or("")
|
.unwrap_or("")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Show release notes of latest pixi release
|
||||||
|
pub fn show_pixi_release_notes(&self) -> bool {
|
||||||
|
self.config_file
|
||||||
|
.pixi
|
||||||
|
.as_ref()
|
||||||
|
.and_then(|s| s.include_release_notes)
|
||||||
|
.unwrap_or(false)
|
||||||
|
}
|
||||||
|
|
||||||
/// Show news on Arch Linux
|
/// Show news on Arch Linux
|
||||||
pub fn show_arch_news(&self) -> bool {
|
pub fn show_arch_news(&self) -> bool {
|
||||||
self.config_file
|
self.config_file
|
||||||
|
|||||||
@@ -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.
|
// 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.
|
// 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") {
|
if top_level_help_output.stdout.contains("self-update") {
|
||||||
ctx.run_type()
|
let self_update_help_output = ctx
|
||||||
|
.run_type()
|
||||||
.execute(&pixi)
|
.execute(&pixi)
|
||||||
.args(["self-update"])
|
.args(["self-update", "--help"])
|
||||||
.status_checked()
|
.output_checked_utf8()?;
|
||||||
.ok();
|
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()
|
ctx.run_type()
|
||||||
|
|||||||
Reference in New Issue
Block a user