-
-
Notifications
You must be signed in to change notification settings - Fork 203
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
Improve documentation of global script options #870
Conversation
It may be less confusing to do this, since we already use import {$ as $_} from 'execa';
const $ = $_(options); |
For the other places where we are using In other words, maybe we should replace all |
I like the distinction between a global |
3cb7c1a
to
bcbcc07
Compare
Thanks for your input @tommy-mitchell and @aaronccasanova, let's go with what you suggest:
In the end, those are just variable names, and users could use different ones, but it's nice to have a convention. I have updated the PR accordingly. |
//=> 'unicorns' | ||
|
||
await $$`echo rainbows`; | ||
await $`echo rainbows`; | ||
//=> 'rainbows' | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file also includes an example of const $$ = $(options)
for shared options. It shows the following text, which did not need to be changed:
This can be used to either:
- Set options for a specific command: `$(options)`command` `
- Share options for multiple commands: `const $$ = $(options); $$`command`; $$`otherCommand`;`
This improves the documentation related to sharing options with
$
.Unfortunately, users cannot just do:
Because imports are
const
.Doing the following:
Requires renaming all
$
to$$
in the file.The following does not require any renaming:
I've tried thinking of a better pattern, but could not come up with one. :/