From f032cb587b5893be072f8f6b92f920fb14b16447 Mon Sep 17 00:00:00 2001 From: ehmicky Date: Tue, 25 Jun 2019 10:00:00 +0200 Subject: [PATCH] Improve the `execa.command()` documentation --- index.d.ts | 2 ++ readme.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/index.d.ts b/index.d.ts index 76e320791e..f29c6d2601 100644 --- a/index.d.ts +++ b/index.d.ts @@ -407,6 +407,8 @@ declare const execa: { If the file or an argument contains spaces, they must be escaped with backslashes. This matters especially if `command` is not a constant but a variable, for example with `__dirname` or `process.cwd()`. Except for spaces, no escaping/quoting is needed. + The `shell` option must be used if the `command` uses shell-specific features, as opposed to being a simple `file` followed by its `arguments`. + @param command - The program/script to execute and its arguments. @returns A [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess), which is enhanced to also be a `Promise` for a result `Object` with `stdout` and `stderr` properties. diff --git a/readme.md b/readme.md index 4359557c81..fd5da3595f 100644 --- a/readme.md +++ b/readme.md @@ -178,6 +178,8 @@ Same as [`execa()`](#execafile-arguments-options) except both file and arguments If the file or an argument contains spaces, they must be escaped with backslashes. This matters especially if `command` is not a constant but a variable, for example with `__dirname` or `process.cwd()`. Except for spaces, no escaping/quoting is needed. +The [`shell` option](#shell) must be used if the `command` uses shell-specific features, as opposed to being a simple `file` followed by its `arguments`. + ### execa.commandSync(command, [options]) Same as [`execa.command()`](#execacommand-command-options) but synchronous.