Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--gruntfile flag not respected #13

Closed
jefflembeck opened this issue Apr 2, 2013 · 6 comments
Closed

--gruntfile flag not respected #13

jefflembeck opened this issue Apr 2, 2013 · 6 comments

Comments

@jefflembeck
Copy link
Contributor

If I run the command

grunt --gruntfile="path/to/Gruntfile.js"

from a folder that is not where Grunt or a Gruntfile is located, a fatal error is automatically thrown.

The same thing happens with:

grunt --base="path/to/gruntfile/dir"

These should be able to be run without referencing Grunt.

@tkellen
Copy link
Member

tkellen commented Apr 5, 2013

ping @cowboy

@cowboy
Copy link
Member

cowboy commented Apr 5, 2013

Now that we're using require to determine where the Grunt lib has been installed, you unfortunately can't run the grunt command from a directory that isn't a subdirectory of where Grunt has been installed. If that makes any sense.

One way we could work around this is to make grunt-cli aware of the --gruntfile flag, but that will complicate the cli tool.

@tkellen
Copy link
Member

tkellen commented Apr 5, 2013

https://github.com/substack/node-resolve supports using a basedir.

@cowboy
Copy link
Member

cowboy commented Apr 5, 2013

Right. So the solution is to check and see if --gruntfile is specified, and if so, extract the path part and resolve from there. Can you see a more elegant way?

@tkellen
Copy link
Member

tkellen commented Apr 5, 2013

Nope, you're totally on point. We should probably spend some time figuring out what the best separation of concerns is for the cli/grunt split, though.

jefflembeck added a commit to jefflembeck/grunt-cli that referenced this issue May 22, 2013
@tkellen
Copy link
Member

tkellen commented May 26, 2013

Merged and published as 0.1.9, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants