Skip to content

Several actions and some with condition. #1063

@Blady-Com

Description

@Blady-Com

(Edited: the conditions were obviously misplaced, that don't change the relevance of the answer)
For our example crate, let have two post-fetch actions cmd_A and cmd_B, this gives:

[[actions]]
type = "post-fetch"
command = ["cmd_A", "-p1"]

[[actions]]
type = "post-fetch"
command = ["cmd_B", "-p2"]

But cmd_A takes -p1 on Linux and --p1 on macOS, so I might write:

[[actions.'case(os)'.linux]]
type = "post-fetch"
command = ["cmd_A", "-p1"]

[[actions.'case(os)'.macos]]
type = "post-fetch"
command = ["cmd_A", "--p1"]

[[actions]]
type = "post-fetch"
command = ["cmd_B", "-p2"]

But I get an error:

error:    action #1:
error:    forbidden extra entries: case(os)

How to get several actions and some with condition?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions