Skip to content

Commit

Permalink
fix(recursive): store.json is saved only once during recursive link
Browse files Browse the repository at this point in the history
  • Loading branch information
zkochan committed Apr 6, 2018
1 parent 64e843c commit ad12700
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/cmd/recursive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,22 @@ export default async (
})
const pkgGraphResult = createPkgGraph(pkgs)
const store = await createStoreController(opts)

// It is enough to save the store.json file once,
// once all installations are done.
// That's why saveState that is passed to the install engine
// does nothing.
const saveState = store.ctrl.saveState
const storeController = {
...store.ctrl,
saveState: async () => undefined,
}

if (cmd === 'link' || cmd === 'ln') {
await linkPackages(pkgGraphResult.graph, {
registry: opts.registry,
store: store.path,
storeController: store.ctrl,
storeController,
})
}
const graph = new Map(
Expand All @@ -78,15 +89,6 @@ export default async (
})
const chunks = graphSequencerResult.chunks

// It is enough to save the store.json file once,
// once all installations are done.
// That's why saveState that is passed to the install engine
// does nothing.
const saveState = store.ctrl.saveState
const storeController = {
...store.ctrl,
saveState: async () => undefined,
}
const installOpts = Object.assign(opts, {
store: store.path,
storeController,
Expand Down

0 comments on commit ad12700

Please sign in to comment.