Make it easier to use inside npm script
rofrol opened this issue ยท 6 comments
rofrol commented
Right now I need to do this:
"scripts": {
"ls": "node -e \"console.log(require('cash')('ls -l')); process.exit();\""
}
dthree commented
I think this is a problem with any Node process running in NPM scripts.
There's a discussion here about integrating Cash into NPM to handle package scripts:
But that's way down the road. Working it!
BTW, you can skip the process.exit()
, it should quit by itself.
Also, try this:
"ls": "node ./bin/cash ls -l"
rofrol commented
I need to use process.exit()
otherwise it hangs.
I don't want to just use ls
but use cash today in npm scripts.
So I thought that to make transition easier, add some option to cash, so that we can use
"scripts": {
"watch": "cash \"browserify -w index.js && postcss -w\""
}
nfischer commented
Perhaps we could implement the -c
option. From Bash's man page:
-c If the -c option is present, then commands are read from the first non-option argument command_string. If there are arguments after the command_string, they are assigned to the positional parameters, starting with $0.
rofrol commented
๐
danielbayley commented