Skip to content
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
2 changes: 1 addition & 1 deletion src/cli/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ pub async fn execute(args: Args) -> miette::Result<()> {
.iter()
.map(|env| {
let tasks = env
.tasks(None)
.tasks(Some(env.best_platform()))
.ok()
.map(|t| t.into_keys().cloned().collect())
.unwrap_or_default();
Expand Down
2 changes: 1 addition & 1 deletion src/workspace/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ impl<'p> Environment<'p> {
pub fn tasks(
&self,
platform: Option<Platform>,
) -> Result<HashMap<&'p TaskName, &'p Task>, UnsupportedPlatformError> {
) -> Result<IndexMap<&'p TaskName, &'p Task>, UnsupportedPlatformError> {
self.validate_platform_support(platform)?;
let result = self
.features()
Expand Down
21 changes: 21 additions & 0 deletions tests/integration_python/test_main_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1157,3 +1157,24 @@ def test_dont_error_on_missing_platform(pixi: Path, tmp_pixi_workspace: Path) ->
[pixi, "install", "--manifest-path", manifest],
stderr_contains=["pixi project platform add zos-z"],
)


def test_pixi_info_tasks(pixi: Path, tmp_pixi_workspace: Path) -> None:
manifest = tmp_pixi_workspace.joinpath("pixi.toml")
toml = """
[workspace]
name = "test"
channels = []
platforms = ["linux-64", "win-64", "osx-64"]

[tasks]
foo = "echo foo"

[target.unix.tasks]
bar = "echo bar"

[target.win.tasks]
bar = "echo bar"
"""
manifest.write_text(toml)
verify_cli_command([pixi, "info", "--manifest-path", manifest], stdout_contains="foo, bar")
Loading