grunt-verb icon indicating copy to clipboard operation
grunt-verb copied to clipboard

No error messages

Open Melindrea opened this issue 10 years ago • 7 comments

So, today I ended up having an interesting issue. I'd changed my changelog, rebuilt my docs and everything was dandy ... except, the README file wasn't updated.

Doing a few tricks I figured out it's because I don't know how to YAML (whoops ...), but it would be very useful if grunt-verb could halt or toss out errors when there are such.

Melindrea avatar May 06 '14 06:05 Melindrea

Good to know, I'll have to think about how to best do this. l'm not sure where the error would be thrown, since data it's hard to know when data should or shouldn't be used. any thoughts?

jonschlinkert avatar May 06 '14 16:05 jonschlinkert

Well, the CLI version threw some kind of error when I tried it that way. On 05/06/2014 06:45 PM, Jon Schlinkert wrote:

Good to know, I'll have to think about how to best do this. l'm not sure where the error would be thrown, since data it's hard to know when data should or shouldn't be used. any thoughts?

— Reply to this email directly or view it on GitHub https://github.com/assemble/grunt-verb/issues/1#issuecomment-42327351.

Melindrea avatar May 06 '14 16:05 Melindrea

hmm, maybe it's how the context is being merged. can you put some code examples of what you did wrong and what worked?

jonschlinkert avatar May 06 '14 17:05 jonschlinkert

The error was that my YAML file had a comma where it oughtn't.

I have a fairly standard .verbrc.md file with <%= changelog() %>. Running grunt verb I get the following:

Running "verb:readme" (verb) task

Done, without errors.

However, no new README.md file was generated. Fully removing grunt verb and running verb I got the following:

unresolved [ 'verbfile.coffee' ]
   verb-cli [reading] · .verbrc.md

/home/marie/projects/grunt/grunt-epub/node_modules/verb/node_modules/fs-utils/index.js:223
     throw err;
           ^
YAMLException: Failed to parse 
"/home/marie/projects/grunt/grunt-epub/CHANGELOG": JS-YAML: bad 
indentation of a mapping entry at line 2, column 23:
         date: "2014-05-06",

My Gruntfile doesn't have any particular config for verb, using the standard one. On 05/06/2014 07:38 PM, Jon Schlinkert wrote:

hmm, maybe it's how the context is being merged. can you put some code examples of what you did wrong and what worked?

— Reply to this email directly or view it on GitHub https://github.com/assemble/grunt-verb/issues/1#issuecomment-42334014.

Melindrea avatar May 06 '14 17:05 Melindrea

Looks like the verb-cli loads data with plasma automatically, but I don't see that in grunt-verb so this could be the reason no error was being thrown.

After you fixed it the data, does it create the README.md file correctly?

doowb avatar May 06 '14 18:05 doowb

Yep, once I figured out the error and fixed my YAML file everything was dandy. On 05/06/2014 08:20 PM, Brian Woodward wrote:

Looks like the verb-cli loads data with plasma https://github.com/assemble/verb-cli/blob/master/lib/tasks.js#L55 automatically, but I don't see that in grunt-verb so this could be the reason no error was being thrown.

After you fixed it the data, does it create the README.md file correctly?

— Reply to this email directly or view it on GitHub https://github.com/assemble/grunt-verb/issues/1#issuecomment-42339394.

Melindrea avatar May 06 '14 18:05 Melindrea

ok, that was what I was wondering but didn't have a chance to check. so @doowb it sounds like plasma is throwing the error, which is a good thing. gives us a starting point, thanks

jonschlinkert avatar May 06 '14 19:05 jonschlinkert