Skip to content
Myr

Better escaping of `result.escapedCommand` (#875)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by ehmicky · committed by GitHub · parent 146fa07 · Browse files · 6 files+149 added−31 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

6 files+149 added−31 removed

  • tests:+86 added−24 removed
  • other:+63 added−7 removed

6 files+149 added−31 removed

modified:lib/arguments/escape.js+57 added-5 removed
modified:test/arguments/escape.js+74 added-16 removed
modified:test/arguments/verbose.js+10 added-6 removed
modified:test/fixtures/verbose-script.js+2 added-2 removed
modified:index.d.ts+3 added-1 removed
652 unmodified lines
653654 /**655 Same as `command` but escaped.656657 Unlike `command`, control characters are escaped, which makes it safe to print in a terminal.658657 This is meant to be copied and pasted into a shell, for debugging purposes.659 This can also be copied and pasted into a shell, for debugging purposes.660 Since the escaping is fairly basic, this should not be executed directly as a process, including using `execa()` or `execaCommand()`.661 */662 escapedCommand: string;663
717 unmodified lines
modified:readme.md+3 added-1 removed
438 unmodified lines
439Type: `string`440441Same as [`command`](#command-1) but escaped.442443Unlike `command`, control characters are escaped, which makes it safe to print in a terminal.444443This is meant to be copied and pasted into a shell, for debugging purposes.445This can also be copied and pasted into a shell, for debugging purposes.446Since the escaping is fairly basic, this should not be executed directly as a process, including using [`execa()`](#execafile-arguments-options) or [`execaCommand()`](#execacommandcommand-options).447448#### cwd449
593 unmodified lines