arturadib/shelljs — pull request #42 by danielepolencic (2012-11-12 16:39:14+00:00)
Title: Fix issue #11

when exec runs a command with quotes and double quotes, the old escape function escaped everything as double quotes. E.g.

exec( "curl -XPUT 'http://localhost:9200/index/node' -d '{\"key\":\"value\"}' " )

becomes

curl -XPUT "http://localhost:9200/index/node" -d "{"key":"value"}"

and the new script fails. The new escape function adds backslashes (like PHP addslashes).