From 8d7ebe3b04eb0408da8f9630163715ec0a955331 Mon Sep 17 00:00:00 2001 From: dvpetrov Date: Tue, 27 Jun 2017 14:20:39 +0300 Subject: [PATCH 1/2] Correct activators cache work --- init.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/init.js b/init.js index bd0c172..52dc48f 100644 --- a/init.js +++ b/init.js @@ -13,13 +13,12 @@ const scanActivators = () => { } const getActivatorsFromCache = () => { - const cacheActivatorsPath = path.resolve(__dirname, '../../build/activators.json') - - const cache = fs.readJsonSync(cacheActivatorsPath, { throws: false }) + const cachePath = path.resolve(__dirname, '../../build/plugins.json') + const cache = fs.readJsonSync(cachePath, { throws: false }) if (cache) { - const activators = Object.values(cache.packages) - .map(plugin => plugin.activatorPath) + const activators = Object.values(cache.plugins) + .map(plugin => plugin.activator) .filter(activator => !!activator) .map(activator => require(activator)) From e7b24a8d09b24d750580b18045b979cf1d1675c9 Mon Sep 17 00:00:00 2001 From: dvpetrov Date: Tue, 27 Jun 2017 14:23:55 +0300 Subject: [PATCH 2/2] Fix tests --- __tests__/init.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/__tests__/init.test.js b/__tests__/init.test.js index 4958d58..20e0d59 100644 --- a/__tests__/init.test.js +++ b/__tests__/init.test.js @@ -79,9 +79,9 @@ describe('init', () => { mockFs.setMockFiles({ [basePath]: { - packages: { + plugins: { [pluginsNames[0]]: { - activatorPath: activatorsPaths[0], + activator: activatorsPaths[0], }, }, },