jharding / grunt-exec

Grunt plugin for executing shell commands.
https://npmjs.org/package/grunt-exec
Other
248 stars 47 forks source link

Cannot perform command with quotes #84

Closed balanza closed 7 years ago

balanza commented 7 years ago

Hi,

I ran into issues using this plugin. If you need to specify some text using quotes in your command, quotes will be duplicated therefore included as content.

How to reproduce the error Try to execute the following command in shell: mkdir "tmp dir". It correctly creates the directory ./tmp dir. Anyway, if you try to accomplish the same operation with a grunt command mapped like create_dir: { cmd: 'mkdir "tmp dir"' }, it will create the directory ./"tmp dir" (notice how quotes are included).

Affected versions This issue is present on version 2.0.0. I tested on version 1.0.1 and the issue is not present. Thus its a regression.

Possibly duplicated issue I opened this issue as I haven't found any previous that fit my problem. Anyway, those two issues may probably refer to the same bug: https://github.com/jharding/grunt-exec/issues/69 https://github.com/jharding/grunt-exec/issues/81

gwicksted commented 7 years ago

Thank you for the bug report! I hope to get some time to work on the 2.x issues... very busy lately. If you wish to make a PR, I can review and get that into a prerelease faster.

dackmin commented 7 years ago

same issue here, starting with 2.0.0, working great with 1.0.1 when trying to exec :

$ node build/manage.js "create_app" "test"

Error: Cannot find module './config/commands/"create_app"'
...
jayshields commented 7 years ago

Same bug here. Double quotes no longer work in commands. Tried single quotes, escaping with backslash - no luck.

Pettrov commented 7 years ago

Same bug here.

gwicksted commented 7 years ago

Fixed. Please retry with grunt-exec 3.0.0 (bumped major due to possibly breaking changes relying on incorrect quote handling of v2).