Skip to content

Commit 5c17a0d

Browse files
committed
Use async/await over then
1 parent d8f0f62 commit 5c17a0d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import pMapSeries from 'p-map-series'
33

44
const PLUGIN_NAME = 'HooksShellScriptsPlugin'
55

6-
const execute = script =>
7-
execa.shell(script).then(({ stdout, stderr }) => {
8-
if (stdout) process.stdout.write(stdout)
9-
if (stderr) process.stderr.write(stderr)
10-
})
6+
const execute = async script => {
7+
const { stdout, stderr } = await execa.shell(script)
8+
if (stdout) process.stdout.write(stdout)
9+
if (stderr) process.stderr.write(stderr)
10+
}
1111

1212
const registerHook = compiler => ([hook, scripts]) =>
1313
compiler.hooks[hook].tap(PLUGIN_NAME, () => pMapSeries(scripts, execute))

0 commit comments

Comments
 (0)