vendredi 27 février 2015

Grunt - get current calling folder, and not gruntfile current folder

If I have Grunt installed in some folder /foo, but my current folder is /foo/bar/baz, and I run "grunt sometask" from within my current folder, how can I get Grunt (or NodeJS for that matter) to determine my current path? That is to say, how can I programmatically GET the folder I was in when I called grunt?


When I use process.cwd(), I get the path of the gruntfile, ie, "foo", which is not what I want.


I don't have to do this in Grunt specifically, any nodejs-based solution would work.


Aucun commentaire:

Enregistrer un commentaire