Skip to content

Commit

Permalink
Merge pull request #10 from rispa-io/bugfix/correct-activators-cache-…
Browse files Browse the repository at this point in the history
…work

Correct activators cache work
  • Loading branch information
Laiff authored Jun 27, 2017
2 parents 762f029 + e7b24a8 commit bd9b5b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions __tests__/init.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ describe('init', () => {

mockFs.setMockFiles({
[basePath]: {
packages: {
plugins: {
[pluginsNames[0]]: {
activatorPath: activatorsPaths[0],
activator: activatorsPaths[0],
},
},
},
Expand Down
9 changes: 4 additions & 5 deletions init.js
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down

0 comments on commit bd9b5b3

Please sign in to comment.