gajus / create-index

Creates ES6 ./index.js file in target directories that imports and exports all sibling files and directories.
Other
278 stars 87 forks source link

fix: update stopped working with banner #22

Closed laggingreflex closed 7 years ago

laggingreflex commented 7 years ago

With the addition of --banner option index files may no longer start with '// @create-index'

This new regex looks for '// @create-index' that are either at the beginning of the file (old behavior) or if it is followed by a newline. Basically it just checks whether it exists in a file or not.

Also added a test

patch for #20

laggingreflex commented 7 years ago

Rebased for conflicts. Although some (main) part of this was included in #24 which has been merged, this one now just include tests