Fix pixi self-update running when pixi is not installed with the … (#1087)
* Fix `pixi self-update` running when `pixi` is not installed with the `self-update` feature * Format
This commit is contained in:
@@ -553,11 +553,17 @@ pub fn run_pixi_update(ctx: &ExecutionContext) -> Result<()> {
|
|||||||
let pixi = require("pixi")?;
|
let pixi = require("pixi")?;
|
||||||
print_separator("Pixi");
|
print_separator("Pixi");
|
||||||
|
|
||||||
|
// 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()?;
|
||||||
|
|
||||||
|
if String::from_utf8(output.stdout)?.contains("self-update") {
|
||||||
ctx.run_type()
|
ctx.run_type()
|
||||||
.execute(&pixi)
|
.execute(&pixi)
|
||||||
.args(["self-update"])
|
.args(["self-update"])
|
||||||
.status_checked()
|
.status_checked()
|
||||||
.ok();
|
.ok();
|
||||||
|
}
|
||||||
|
|
||||||
ctx.run_type()
|
ctx.run_type()
|
||||||
.execute(&pixi)
|
.execute(&pixi)
|
||||||
|
|||||||
Reference in New Issue
Block a user