sindresorhus / grunt-shell

Run shell commands
MIT License
949 stars 126 forks source link

Issues with Cygwin #82

Closed rr- closed 9 years ago

rr- commented 10 years ago

Consider this simple task:

shell: {
    test: {
        command: 'dir',
    },
}

When I run it on Debian and in Windows cmd, it's executed just fine. When I run it on cygwin, I get following error:

Running "shell:test" (shell) task Warning: EINVAL, invalid argument Use --force to continue.

Aborted due to warnings.

Version of Cygwin:

rr-@work:~$ uname -a
CYGWIN_NT-6.2-WOW64 work 1.7.28(0.271/5/3) 2014-02-09 21:06 i686 Cygwin

At first I thought the problem lies with the underlying child_process module, but after creating following file:

var exec = require('child_process').exec;
exec('ls', function (err, stdout, stderr) {
    console.log(err);
    console.log(stdout);
    console.log(stderr);
});

Running node test.js outputs content of ls just fine.

rr- commented 10 years ago

Heads up: turning off stdin by specifying {options: {stdin: false}} makes the issue go away. It certainly feels like a bug, though. If it's impossible to use stdin on Cygwin, there should be a warning.

sindresorhus commented 9 years ago

Cygwin support is abysmal. I'd suggest using cmd.exe or PowerShell instead.

rr- commented 9 years ago

:-1: