Skip to content

Commit

Permalink
fixup(init-core): save the install cache!
Browse files Browse the repository at this point in the history
  • Loading branch information
dckc committed Apr 24, 2022
1 parent 3156f4e commit 15cfcf7
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/run-protocol/scripts/init-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,16 @@ const makeTool = async (homeP, installCacheKey = 'installCache') => {
/** @type {Map<string, {installation: Installation, boardId: string, path?: string}>} */
const working = new Map(getCopyMapEntries(initial));

const saveCache = async () => {
const final = makeCopyMap(working);
assert.equal(final.payload.keys.length, working.size);
await E(E.get(homeP).scratch).set('installCache', final);
console.log({
initial: initial.payload.keys.length,
total: working.size,
});
};

const wrapInstall = install => async (mPath, bPath, opts) => {
const { endoZipBase64Sha512: sha512 } = await import(bPath).then(
m => m.default,
Expand Down Expand Up @@ -152,7 +162,7 @@ const makeTool = async (homeP, installCacheKey = 'installCache') => {
],
});
};
return { committeeProposalBuilder, mainProposalBuilder };
return { committeeProposalBuilder, mainProposalBuilder, saveCache };
};

// Build proposal for sim-chain etc.
Expand Down Expand Up @@ -194,4 +204,5 @@ export default async (homeP, endowments) => {
writeCoreProposal('gov-econ-committee', tool.committeeProposalBuilder),
writeCoreProposal('gov-amm-vaults-etc', tool.mainProposalBuilder),
]);
await tool.saveCache();
};

0 comments on commit 15cfcf7

Please sign in to comment.