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
Add more documentation for $
#533
Conversation
6c49fbf
to
f823ff5
Compare
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 looks great @ehmicky 🚀
|
||
```js | ||
// zx | ||
within(async () => { |
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.
within(async () => { | |
await within(async () => { |
Does this need to be awaited?
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 does not seem to be the case according to their documentation: https://github.com/google/zx/#within
Although according to their type, it would: https://github.com/google/zx/blob/4999435182fe1f34f6b2ef2471184d9878456b5e/src/core.ts#L436 🤔
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.
Wonder if that's a typo. I saw that and their second example including an await/assignment. Not a show stopper imo
docs/scripts.md
Outdated
### Simplicity | ||
|
||
Execa's scripting API mostly consists of only two methods: [``$`command` ``](../readme.md#command) and | ||
[`$(options)`](../readme.md#options). |
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.
Don't hard-wrap
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.
Fixed 👍
docs/scripts.md
Outdated
import getStdin from 'get-stdin'; | ||
const content = await getStdin(); |
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.
import getStdin from 'get-stdin'; | |
const content = await getStdin(); | |
import getStdin from 'get-stdin'; | |
const content = await getStdin(); |
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.
Fixed 👍
It would be useful to include an example of #528 in here too. |
Co-authored-by: Aaron Casanova <[email protected]>
Co-authored-by: Sindre Sorhus <[email protected]>
Co-authored-by: Sindre Sorhus <[email protected]>
Everything should be fixed! 🚀 An example of #528 is included in the "Subcommands" section |
@aaronccasanova Do you think this might be good to merge? |
This PR adds more documentation for the
$
scripting interface.In particular, it presents its differences with using either Bash or zx.
Please note that some of the features being documented are related to open PRs still being discussed.
Direct link to documentation file in Markdown.
cc @aaronccasanova for code review.