gulpjs / liftoff

Launch your command line tool with ease.
MIT License
843 stars 52 forks source link

Fix the case of only 1 extension #14

Closed kt3k closed 10 years ago

kt3k commented 10 years ago

Hi!

I think I found a bug in the creation of configPathRegex in index.js.

When the extensions parameter has only one entry (for example .js), then configPathRegex become mochafile{.js} (when configName is mochafile). But this string is not treated as glob (brace expansion) pattern, but just as the string itself. So in this case liftoff searches the file mochafile{.js} literally, not mochafile.js.

This behaviour of node-findup-sync (or node-glob) doesn't seem a bug because the document of bash says:

A correctly-formed brace expansion must contain unquoted opening and closing braces, and at least one unquoted comma or a valid sequence expression. Any incorrectly formed brace expansion is left unchanged.

( in https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html )

So I suggest this change.

Thanks!

tkellen commented 10 years ago

You're right @kt3k. This is fixed in the upcoming 0.11 release. I'll be publishing it in the next day or two: https://github.com/tkellen/node-liftoff/blob/0.11/lib/build_config_name_regex.js#L14-L16

tkellen commented 10 years ago

This was addressed in 6369b8b0f084d71faeeb3b887299a1763b28e4b9, and is now available in 0.11. There are some breaking changes, though. Be sure to check out https://github.com/tkellen/node-liftoff/blob/master/UPGRADING.md