Skip to content

Commit

Permalink
fix: Bug #3. Allow to ignore files and folders using globbing
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasdao committed Oct 28, 2017
1 parent 200fe7a commit e70b8ce
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ const glue = (schemaFolderPath, options={}) => {
ignore = (graphql || {}).ignore
}
const schemaFolder = path.join(schemaFolderPath || schemaPathInConfig || 'schema', '**/*.js')
const ignored = options.ignore || ignore
? typeof(options.ignore) == 'string'
? path.join(schemaFolderPath || schemaPathInConfig || 'schema', options.ignore)
: options.ignore.map(i => path.join(schemaFolderPath || schemaPathInConfig || 'schema', i))
const optionIgnore = options.ignore || ignore
const ignored = optionIgnore
? typeof(optionIgnore) == 'string'
? path.join(schemaFolderPath || schemaPathInConfig || 'schema', optionIgnore)
: optionIgnore.map(i => path.join(schemaFolderPath || schemaPathInConfig || 'schema', i))
: undefined

const files = glob.sync(schemaFolder, { ignore: ignored })
Expand Down

0 comments on commit e70b8ce

Please sign in to comment.