Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Yanis Benson committed May 6, 2019
1 parent 075faf3 commit 8899af1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function handleArgs(command, args, options = {}) {
}

function handleInput(spawned, input) {
if (input === undefined) {
if (input === undefined || spawned.stdin === undefined) {
return;
}

Expand Down
6 changes: 6 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,12 @@ if (process.platform !== 'win32') {
const cp = execa('non-executable');
await t.throwsAsync(cp);
});

test('execa() rejects with correct error and doesn\'t throw if running non-executable with input', async t => {
await t.throwsAsync(() => {
return execa('non-executable', {input: 'Hey!'});
}, /EACCES/);
});
}

test('error.killed is true if process was killed directly', async t => {
Expand Down

0 comments on commit 8899af1

Please sign in to comment.