-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
Print a useful error if package.json is missing #61
Print a useful error if package.json is missing #61
Conversation
…sole.log error that package.json is missing
Please spend some more time on the code. |
Yeah, I saw the travis build fail, I will working on it. But beside that, did you saw something wrong? |
Can you change the pull request title to be more descriptive? It should concisely explain what this PR fixes. Also include |
index.js
Outdated
@@ -11,6 +11,11 @@ module.exports = (grunt, options = {}) => { | |||
|
|||
let cwd = process.cwd(); | |||
let config = options.config || pkgUp.sync(); | |||
|
|||
if (config === null) { | |||
grunt.fail.fatal('package.json not found.\nPlease make sure to create a package.json and install all dependecies before run a grunt task.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have some typos.
grunt.fail.fatal('package.json not found.\nPlease make sure to create a package.json and install all dependecies before run a grunt task.'); | |
grunt.fail.fatal('package.json not found.\nPlease make sure to create a package.json and install all dependencies before you run Grunt.'); |
Hello!
This fixes #60
If I understand it right we need to check if the package.json is missing or not, like @kirbysayshi said it on the issue.
In this case I made a small condition to check this
['undefined', null].indexOf(config) > 0
.Let me know if there is more about this issue than this.
IssueHunt Summary
Referenced issues
This pull request has been submitted to:
IssueHunt has been backed by the following sponsors. Become a sponsor