Skip to content

Commit

Permalink
fix: don't reinstall the wallet unless it's the first time
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Aug 27, 2020
1 parent c871f47 commit 8637331
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions packages/agoric-cli/lib/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ export default async function deployMain(progname, rawArgs, powers, opts) {
const provide = opts.provide
.split(',')
.map(dep => dep.trim())
.filter(dep => dep);
.filter(dep => dep)
.sort();

const need = opts.need
.split(',')
.map(dep => dep.trim())
.filter(dep => dep && !provide.includes(dep));
.filter(dep => dep && !provide.includes(dep))
.sort();

if (args.length === 0 && !provide.length) {
console.error('you must specify at least one deploy.js (or --provide=XXX)');
Expand Down Expand Up @@ -92,6 +94,22 @@ export default async function deployMain(progname, rawArgs, powers, opts) {
lastUpdateCount,
);
lastUpdateCount = update.updateCount;

// Skip the deploy if our provides are not needed.
let needsProvide = !provide.length;
const notNeeded = [];
for (const dep of provide) {
if (update.value.includes(dep)) {
needsProvide = true;
} else {
notNeeded.push(dep);
}
}
if (!needsProvide) {
console.info(`Don't need our provides: ${notNeeded.join(', ')}`);
return 0;
}

const nextLoading = [];
for (const dep of stillLoading) {
if (update.value.includes(dep)) {
Expand Down

0 comments on commit 8637331

Please sign in to comment.