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

CLI options cwd and require are not parsed correctly in v1.3.0 #121

Closed
stuikomma opened this issue Aug 18, 2018 · 2 comments
Closed

CLI options cwd and require are not parsed correctly in v1.3.0 #121

stuikomma opened this issue Aug 18, 2018 · 2 comments
Assignees
Labels

Comments

@stuikomma
Copy link

When running grunt --require coffeescript/register I get the warning Warning: Task "coffeescript/register" not found. Use --force to continue.

#117 introduced the cli options cwd and require. They are accessed here, but they are treated as boolean flags, because they are not passed as known arguments to nopt. This means that the arguments to cwd and require end up being interpreted as tasks names.

I think they should be added to the known object like this:

// Populate known object with args from grunt-known-options
// ...

// Add options that are unique to grunt-cli
known.cwd = {type: String};
known.require = {type: Array};

var options = nopt(known, aliases, process.argv, 2);
@shama
Copy link
Member

shama commented Aug 19, 2018

Thanks for the report! I published a fix for require. A fresh npm install should grab that fix.

I mistakenly added the cwd option instead of using the existing base option. Please use base instead of cwd. Fix for that here: #122

@shama
Copy link
Member

shama commented Aug 19, 2018

Fixed with 1.3.1

@shama shama closed this as completed Aug 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants