From e70b8ce7b77590af8e8be7cf8f99c580e881f9b2 Mon Sep 17 00:00:00 2001 From: Nic Date: Sun, 29 Oct 2017 02:16:56 +1100 Subject: [PATCH] fix: Bug #3. Allow to ignore files and folders using globbing --- index.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index a659bc8..0261ee4 100644 --- a/index.js +++ b/index.js @@ -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 })