zifeo / whiz

Modern DAG/tasks runner for multi-platform monorepos with live reloading, env management, pipes, and more in a tabbed view.
https://metatype.dev/docs/reference/ecosystem?utm_source=github&utm_medium=about&utm_campaign=whiz
Mozilla Public License 2.0
19 stars 14 forks source link

feat(option): add `pipe` task option #16

Closed msga-mmm closed 1 year ago

msga-mmm commented 1 year ago

Add pipe option for jobs to allow to redirect the output to a new tab or file.

The pipes take a regular expression that is used to capture the desired output and a destination where the content captured would be sent, the destination can be a new tab or a file and their name can be dynamic using the captured groups of the regex.

For example, this config example:

friends_conversation:
    command: |
        echo "[message] Dave: hello"
        echo "[message] Bob: bonjour"

    pipe:
        # Dynamic naming for virtual tabs generation
        '^\[message\] (?P<name>[a-zA-Z]+):.*$': whiz://talker_${name}

Gives this result:

whiz-pipes-example_dynamic-naming

zifeo commented 1 year ago

@msga-mmm Great! Can you resolve the conflict so I can approve it?

msga-mmm commented 1 year ago

@msga-mmm Great! Can you resolve the conflict so I can approve it?

Done :heavy_check_mark:

I have also added support for dynamic naming for virtual tabs in case it might be useful.