sindresorhus / grunt-shell

Run shell commands
MIT License
949 stars 126 forks source link

This socket is closed #108

Closed lynchmaniac closed 8 years ago

lynchmaniac commented 8 years ago

Hi,

Thanks for your great package. I have one problem with this package. Sometimes the grunt shell failed with the error :

Running "shell:updateCVS" (prompt) task

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: This socket is closed.
    at WriteStream.Socket._write (net.js:637:19)
    at doWrite (_stream_writable.js:226:10)
    at writeOrBuffer (_stream_writable.js:216:5)
    at WriteStream.Writable.write (_stream_writable.js:183:11)
    at WriteStream.Socket.write (net.js:615:40)

the shell:

updateCVS: {
        command: [
            'cd <%= projectsLocation %><%= grunt.task.current.args[0] %> ',
            'cvs -d :pserver:<%= grunt.task.current.args[1] %>:<%= grunt.task.current.args[2] %>@<URL>:<PORT>/pepsi/data/cvs/<DIRECTORY>'
        ].join('&&')
    },

Some updateCVS is executed before without issues. but sometimes things goes wrong. I think that there a problem during the update and the update after the socket is close. When the shell begin is it possible to check if the socket is open to avoid this issues ? I used v1.3.0 of grunt-shell with grunt v0.4.5 Thanks for any ideas or suggestions

sindresorhus commented 8 years ago

http://blog.johanbove.info/blog/2015/06/09/gruntwindowsthesocketisclosederror.html

lynchmaniac commented 8 years ago

Hi Thnaks for this link. But in this article it's just a workaround not a solution. Furthermore this tips doesn't work for me. I have some prompt in my construction. Despite i remove the prompt from my construction, it's still failed. So i don't understand why you close the issues. Can you explain to me ?