Skip to content
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

fix: pixi global upgrade-all error message #2296

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/cli/global/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use rattler_conda_types::Platform;
use crate::cli::{cli_config::ChannelsConfig, has_specs::HasSpecs};

/// Upgrade specific package which is installed globally.
/// This command has been removed, please use `pixi global update` instead
#[derive(Parser, Debug)]
// TODO: Uncomment as soon we implement this
//#[clap(arg_required_else_help = true)]
Expand All @@ -29,7 +30,7 @@ impl HasSpecs for Args {

pub async fn execute(_args: Args) -> miette::Result<()> {
Err(
miette::miette!("You can use `pixi global update` for most use cases").wrap_err(
miette::miette!("You can call `pixi global update` for most use cases").wrap_err(
"`pixi global upgrade` has been removed, and will be re-added in future releases",
),
)
Expand Down
25 changes: 9 additions & 16 deletions src/cli/global/upgrade_all.rs
Original file line number Diff line number Diff line change
@@ -1,34 +1,27 @@
use clap::Parser;
use pixi_config::ConfigCli;
use rattler_conda_types::Platform;

use crate::cli::{cli_config::ChannelsConfig, has_specs::HasSpecs};
use crate::cli::cli_config::ChannelsConfig;

/// Upgrade specific package which is installed globally.
/// Upgrade all globally installed packages
/// This command has been removed, please use `pixi global update` instead
#[derive(Parser, Debug)]
#[clap(arg_required_else_help = true)]
pub struct Args {
/// Specifies the packages to upgrade.
//#[arg(required = true)]
pub specs: Vec<String>,

#[clap(flatten)]
channels: ChannelsConfig,

#[clap(flatten)]
config: ConfigCli,

/// The platform to install the package for.
#[clap(long, default_value_t = Platform::current())]
platform: Platform,
}

impl HasSpecs for Args {
fn packages(&self) -> Vec<&str> {
self.specs.iter().map(AsRef::as_ref).collect()
}
}

pub async fn execute(_args: Args) -> miette::Result<()> {
Err(
miette::miette!("You can use `pixi global update` for most use cases").wrap_err(
"`pixi global upgrade-all` has been removed, and will be re-added in future releases",
),
miette::miette!("You can call `pixi global update` for most use cases")
.wrap_err("`pixi global upgrade-all` has been removed"),
)
}
Loading