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

Allow default values when args is empty #259

Open
piranna opened this issue Jul 10, 2023 · 1 comment
Open

Allow default values when args is empty #259

piranna opened this issue Jul 10, 2023 · 1 comment

Comments

@piranna
Copy link

piranna commented Jul 10, 2023

npm-run-all/lib/index.js

Lines 51 to 56 in bf91f94

if (id === "@") {
return shellQuote.quote(args)
}
if (id === "*") {
return shellQuote.quote([args.join(" ")])
}

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
Copy link
Author

piranna commented Jul 10, 2023

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.

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