Skip to content

Commit

Permalink
Fix semicolons and spaces in documentation examples (#547)
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky authored Mar 11, 2023
1 parent db2ad9a commit b260fa4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
18 changes: 9 additions & 9 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -537,15 +537,15 @@ await execa('echo', ['unicorns']).pipeStdout('stdout.txt');
await execa('echo', ['unicorns']).pipeStderr('stderr.txt');
// Similar to `echo unicorns &> stdout.txt` in Bash
await execa('echo', ['unicorns'], {all:true}).pipeAll('all.txt');
await execa('echo', ['unicorns'], {all: true}).pipeAll('all.txt');
```
@example <caption>Redirect input from a file</caption>
```
import {execa} from 'execa';
// Similar to `cat < stdin.txt` in Bash
const {stdout} = await execa('cat', {inputFile:'stdin.txt'});
const {stdout} = await execa('cat', {inputFile: 'stdin.txt'});
console.log(stdout);
//=> 'unicorns'
```
Expand Down Expand Up @@ -648,7 +648,7 @@ console.log(stdout);
import {execa} from 'execa';
// Similar to `cat < stdin.txt` in Bash
const {stdout} = execaSync('cat', {inputFile:'stdin.txt'});
const {stdout} = execaSync('cat', {inputFile: 'stdin.txt'});
console.log(stdout);
//=> 'unicorns'
```
Expand Down Expand Up @@ -794,15 +794,15 @@ type Execa$<StdoutStderrType extends StdoutStderrAll = string> = {
```
import {$} from 'execa';
const branch = $.sync`git branch --show-current`
$.sync`dep deploy --branch=${branch}`
const branch = $.sync`git branch --show-current`;
$.sync`dep deploy --branch=${branch}`;
```
@example <caption>Multiple arguments</caption>
```
import {$} from 'execa';
const args = ['unicorns', '&', 'rainbows!']
const args = ['unicorns', '&', 'rainbows!'];
const {stdout} = $.sync`echo ${args}`;
console.log(stdout);
//=> 'unicorns & rainbows!'
Expand Down Expand Up @@ -853,15 +853,15 @@ The `command` string can inject any `${value}` with the following types: string,
```
import {$} from 'execa';
const branch = await $`git branch --show-current`
await $`dep deploy --branch=${branch}`
const branch = await $`git branch --show-current`;
await $`dep deploy --branch=${branch}`;
```
@example <caption>Multiple arguments</caption>
```
import {$} from 'execa';
const args = ['unicorns', '&', 'rainbows!']
const args = ['unicorns', '&', 'rainbows!'];
const {stdout} = await $`echo ${args}`;
console.log(stdout);
//=> 'unicorns & rainbows!'
Expand Down
10 changes: 5 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,16 @@ For more information about Execa scripts, please see [this page](docs/scripts.md
```js
import {$} from 'execa';

const branch = await $`git branch --show-current`
await $`dep deploy --branch=${branch}`
const branch = await $`git branch --show-current`;
await $`dep deploy --branch=${branch}`;
```

#### Multiple arguments

```js
import {$} from 'execa';

const args = ['unicorns', '&', 'rainbows!']
const args = ['unicorns', '&', 'rainbows!'];
const {stdout} = await $`echo ${args}`;
console.log(stdout);
//=> 'unicorns & rainbows!'
Expand Down Expand Up @@ -119,7 +119,7 @@ await execa('echo', ['unicorns']).pipeStdout('stdout.txt');
await execa('echo', ['unicorns']).pipeStderr('stderr.txt');

// Similar to `echo unicorns &> stdout.txt` in Bash
await execa('echo', ['unicorns'], {all:true}).pipeAll('all.txt');
await execa('echo', ['unicorns'], {all: true}).pipeAll('all.txt');
```

#### Redirect input from a file
Expand All @@ -128,7 +128,7 @@ await execa('echo', ['unicorns'], {all:true}).pipeAll('all.txt');
import {execa} from 'execa';

// Similar to `cat < stdin.txt` in Bash
const {stdout} = await execa('cat', {inputFile:'stdin.txt'});
const {stdout} = await execa('cat', {inputFile: 'stdin.txt'});
console.log(stdout);
//=> 'unicorns'
```
Expand Down

0 comments on commit b260fa4

Please sign in to comment.