Skip to content

Feature request: "dry run flags" for shell commands #1158

@BatmanAoD

Description

@BatmanAoD

In dry-run mode, Knope prints shell commands that would be run, but does not actually run them.

In some cases, the CLI tool that Knope is invoking has its own "dry-run" mode, and it would be useful to run that to validate that the command being run is correct.

I suggest something like:

[[workflows.steps]]
type = "Command"
dry_run_flag = "--dry-run"
command = "git push -o ci.skip"

...and the resulting command when running knope release --dry-run would be git push -o ci.skip --dry-run, which would be both printed and executed.

One problem with this is that there are probably tools where adding the flag at the end doesn't work, so perhaps there could be a "magic" $dryrun variable to handle more complex cases:

[[workflows.steps]]
type = "Command"
shell = true
dryrun = "--dry-run"
command = "git push $dryrun -o ci.skip && git push $dryrun -o ci.skip --tags""

Here, $dryrun would be empty unless --dry-run is passed to Knope, and set to --dry-run otherwise.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions