Skip to content

Commit

Permalink
fix: Allow the tasks for all platforms to be shown in info (prefix-de…
Browse files Browse the repository at this point in the history
…v#728)

Previously `pixi info` would only show the tasks for one platform, but I
don't think that is the most helpful. So now it shows all the tasks.
Also if they are not supported.
  • Loading branch information
ruben-arts authored Jan 30, 2024
1 parent 65bd892 commit ccbcf9e
Showing 1 changed file with 31 additions and 28 deletions.
59 changes: 31 additions & 28 deletions src/cli/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,34 +307,37 @@ pub async fn execute(args: Args) -> miette::Result<()> {
.map(|p| {
p.environments()
.iter()
.map(|env| EnvironmentInfo {
name: env.name().as_str().to_string(),
features: env.features().map(|f| f.name.to_string()).collect(),
solve_group: env.manifest().solve_group.clone(),
environment_size: None,
dependencies: env
.dependencies(None, Some(Platform::current()))
.names()
.map(|p| p.as_source().to_string())
.collect(),
pypi_dependencies: env
.pypi_dependencies(Some(Platform::current()))
.into_iter()
.map(|(name, _p)| name.as_str().to_string())
.collect(),
platforms: env.platforms().into_iter().collect(),
channels: env
.channels()
.into_iter()
.filter_map(|c| c.name.clone())
.collect(),
// prefix: env.dir(),
tasks: env
.tasks(Some(Platform::current()))
.expect("Current environment should be supported on current platform")
.into_keys()
.map(|k| k.to_string())
.collect(),
.map(|env| {
let tasks = env
.tasks(None)
.ok()
.map(|t| t.into_keys().map(|k| k.to_string()).collect())
.unwrap_or_default();

EnvironmentInfo {
name: env.name().as_str().to_string(),
features: env.features().map(|f| f.name.to_string()).collect(),
solve_group: env.manifest().solve_group.clone(),
environment_size: None,
dependencies: env
.dependencies(None, Some(Platform::current()))
.names()
.map(|p| p.as_source().to_string())
.collect(),
pypi_dependencies: env
.pypi_dependencies(Some(Platform::current()))
.into_iter()
.map(|(name, _p)| name.as_str().to_string())
.collect(),
platforms: env.platforms().into_iter().collect(),
channels: env
.channels()
.into_iter()
.filter_map(|c| c.name.clone())
.collect(),
// prefix: env.dir(),
tasks,
}
})
.collect()
})
Expand Down

0 comments on commit ccbcf9e

Please sign in to comment.