Skip to content

Wait for command exit code #340

@W1M0R

Description

@W1M0R

Sometimes I need a cross-platform (windows and linux) way to wait for a certain command invocation to succeed or fail. Most examples that I've seen require writing a while-loop in your favourite scripting language.

It would be nice if wait4x could have a command mode that would essentially allow those platform-specific shell scripts to be reduced to a cross-platform one-liner:

# This command waits until `just check-foo` has a success exit-code:
wait4x command 'just check-foo' 
# This command waits until `just check-foo` has a no success exit-code:
wait4x command 'just check-foo' --reverse
# This command waits until `just check-foo` has a specific exit-code 1:
wait4x command 'just check-foo' --expect-exit-code 1
# This command waits until `just check-foo` has any exit-code that is not 0:
wait4x command 'just check-foo' --expect-exit-code-not 0

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