jolicode / castor

🦫 DX oriented task runner and command launcher built with PHP.
https://castor.jolicode.com
MIT License
408 stars 21 forks source link

Make it easier to run multiple tasks sequentially #540

Open ruudk opened 4 days ago

ruudk commented 4 days ago

When migrating from Composer scripts, one feature I really like is that you can define a script that invokes multiple other scripts.

For example:

    "scripts": {
        "dependencies": "vendor/bin/composer-dependency-analyser @additional_args",
        "editorconfig": "vendor/bin/ec",
        "php-cs-fixer": "vendor/bin/php-cs-fixer fix --diff --ansi @additional_args",
        "phpstan": "vendor/bin/phpstan @additional_args",
        "qa": [
            "@composer normalize --diff",
            "@php-cs-fixer",
            "@phpstan",
            "@tests",
            "@dependencies",
            "@editorconfig"
        ],
        "tests": "vendor/bin/phpunit"
    },

The qa script invokes others.

I know I can write this myself, but I feel a lot of people want something like this, so wouldn't it be an idea to make it easy for people to group certain tasks, and execute them using a single alias?

As soon as 1 task fails, it should stop.

I don't want to use parallel for this, because sometimes that's not possible.

lyrixx commented 3 days ago

I know I can write this myself, but I feel a lot of people want something like this, so wouldn't it be an idea to make it easy for people to group certain tasks, and execute them using a single alias?

I'm not sure to understand how you imagine the solution. Can you share an example?