mysticatea / npm-run-all

A CLI tool to run multiple npm-scripts in parallel or sequential.
MIT License
5.72k stars 240 forks source link

Allow default values when args is empty #259

Open piranna opened 1 year ago

piranna commented 1 year ago

https://github.com/mysticatea/npm-run-all/blob/bf91f94ce597aa61da37d2e4208ce8c48bc86673/lib/index.js#L51-L56

If we have a variable expansion with @ or *, we are expanding it unconditionally to the provided args, also if they are empty (no elements array or empty string, respectively), while in that case POSIX variable expansion take the provided default values, if any.

piranna commented 1 year ago

In addition to that, maybe we should allow to define the placeholders with a $ prefix too, to make it more similar to shell variable expansions, and don't have two different sintaxis (with and without npm-run-all). In the regexp is as easy as allowing an optional $ leading character.