Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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) {
Comment thread
stroncium marked this conversation as resolved.
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(() => {
Comment thread
ehmicky marked this conversation as resolved.
Outdated
return execa('non-executable', {input: 'Hey!'});
}, /EACCES/);
});
}

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