sindresorhus / grunt-shell

Run shell commands
MIT License
949 stars 126 forks source link

Passing argument with a colon (like a URL) #87

Closed runlevelsix closed 9 years ago

runlevelsix commented 9 years ago

I'm at a loss for how to escape passing an argument into the shell command. I'm escaping with single quotes, double quotes, back ticks, backslash, etc and no matter how I pass the url, it always only see 'http' as the parameter.

I'm trying to run a couchapp push command

dbPath = "http://user:pass@localhost:5984/" + clientData.webapp_config.db;
grunt.task.run('shell:pushdocs:' + webappPath + ':\''+ dbPath +'\'');

It always returns:

Running "shell:pushdocs:clientbuilds/webapp:'http://user:pass@localhost:5984/
estante-testing'" (shell) task
http

My setup for debugging is this:

    grunt.initConfig({
        shell: {
            pushdocs: {
                command: function(webappPath, dbPath) {
                  return 'echo ' + dbPath + '\n';
                }
            }
        }
    });

Have I completely missed something about passing this URL in javascript?

sindresorhus commented 9 years ago

Use StackOverflow for support questions ;)