verbose / verb-repo-helpers

Commonly used helpers for adding repository-related data to templates in verb projects.
MIT License
5 stars 3 forks source link

maybeInclude seems to not work (for me?) #3

Open tunnckoCore opened 6 years ago

tunnckoCore commented 6 years ago

I have maybeInclude('docs/API.md')

And when it not exists, it's okey. But when exists it does not includes it.

Using ifExists helpers the things are working correctly.

ifExists('docs/API.md', include('docs/API.md'))

jonschlinkert commented 6 years ago

maybeInclude seems to not work (for me?)

That's why it's not called definitelyInclude lol. jk

@doowb or I can take a look and see what's happening.

doowb commented 6 years ago

It looks like 'docs/API.md' would need to be on the context for it to try to include it.

I'm not sure that's entirely correct logic. It might need to be something like:

if (opts[name] || utils.anyExists(name, this.app.cwd)) {
  const fn = this.app.getAsyncHelper(helperName);
  return fn.apply(this, arguments);
}

I think this will find includes that are already on the context and check the filesystem if they aren't.

tunnckoCore commented 6 years ago

It's okey to me to use ifExists anyway, i'm just reporting if it's not correct behavior.

Feel free to close if you both decide. ;]

(edit: side note... what you use for terminal recordings (and gifs)? any ideas? ;d)

jonschlinkert commented 6 years ago

what you use for terminal recordings (and gifs)? any ideas?

I use http://recordit.co/ sometimes. I'd like to find something that is better for terminal recordings though