From ed8e1d069976d61940e322257edaefa7c6d427b3 Mon Sep 17 00:00:00 2001 From: James Lewis Date: Fri, 8 Dec 2017 10:15:38 -0500 Subject: [PATCH] feat: using writeIndex programatically was not respecting passed options configuration (#41) * Create .gitattributes * pass full options object to createIndexCode in writeIndex --- .gitattributes | 1 + src/utilities/writeIndex.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..fcadb2c --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text eol=lf diff --git a/src/utilities/writeIndex.js b/src/utilities/writeIndex.js index eea57fc..d12d96a 100644 --- a/src/utilities/writeIndex.js +++ b/src/utilities/writeIndex.js @@ -17,7 +17,7 @@ export default (directoryPaths, options = {}) => { const config = readIndexConfig(directoryPath); const optionsWithConfig = Object.assign({}, options, {config}); const siblings = readDirectory(directoryPath, optionsWithConfig); - const indexCode = createIndexCode(siblings, {config}); + const indexCode = createIndexCode(siblings, optionsWithConfig); const indexFilePath = path.resolve(directoryPath, 'index.js'); fs.writeFileSync(indexFilePath, indexCode);