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

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

Open
BatmanAoD opened this issue Aug 13, 2024 · 0 comments
Open

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

BatmanAoD opened this issue Aug 13, 2024 · 0 comments

Comments

@BatmanAoD
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant