shelljs / shx

Portable Shell Commands for Node
MIT License
1.73k stars 45 forks source link

use shx for npm script #29

Closed gasolin closed 8 years ago

gasolin commented 8 years ago

I'm curious the possibility if shx could be a better alternative to run npm scripts in platform independent way

ariporad commented 8 years ago

Hi @gasolin!

That's exactly why we invented shx, we wanted a way to use shelljs in npm scripts.

Once we release the first version of shx, you'll be able to do something like this:

{
  "scripts": {
    "do:something": "shx rm -rf build dist; shx echo Done"
  }
}
levithomason commented 8 years ago

You've hit it on the head ;) Closing this for good house keeping, feel free to open if there are any further questions.

gasolin commented 8 years ago

Looking forward it!

levithomason commented 8 years ago

@gasolin shx is now available on npm:

npm i shx -D
gasolin commented 8 years ago

Thanks!

In the initial test, I found shx does not work in npm script (compare to rimraf and mkdirp) might be the path issue.

(installed via npm install --save-dev shx)

levithomason commented 8 years ago

Thanks @gasolin, could you open a new issue with steps to reproduce?

nfischer commented 8 years ago

@levithomason please see #44

gasolin commented 8 years ago

now it works, thanks!