diff --git a/packages/agoric-cli/src/main.js b/packages/agoric-cli/src/main.js index 2e1e9a69d5c..18315708b24 100644 --- a/packages/agoric-cli/src/main.js +++ b/packages/agoric-cli/src/main.js @@ -1,23 +1,24 @@ /* global process */ -import { Command } from 'commander'; -import path from 'path'; -import url from 'url'; import { assert, details as X } from '@agoric/assert'; import { - DEFAULT_KEEP_POLLING_SECONDS, DEFAULT_JITTER_SECONDS, + DEFAULT_KEEP_POLLING_SECONDS, } from '@agoric/casting'; +import { Command } from 'commander'; +import path from 'path'; +import url from 'url'; +import { makeWalletCommand } from './commands/wallet.js'; import cosmosMain from './cosmos.js'; import deployMain from './deploy.js'; -import runMain from './run.js'; -import publishMain from './main-publish.js'; +import followMain from './follow.js'; import initMain from './init.js'; import installMain from './install.js'; +import { statPlans } from './lib/bundles.js'; +import publishMain from './main-publish.js'; +import walletMain from './open.js'; +import runMain from './run.js'; import setDefaultsMain from './set-defaults.js'; import startMain from './start.js'; -import followMain from './follow.js'; -import walletMain from './open.js'; -import { makeWalletCommand } from './commands/wallet.js'; const DEFAULT_DAPP_TEMPLATE = 'dapp-offer-up'; const DEFAULT_DAPP_URL_BASE = 'https://github.com/Agoric/'; @@ -46,6 +47,7 @@ const main = async (progname, rawArgs, powers) => { return true; } + // XXX exits process when fn resolves function subMain(fn, args, options) { return fn(progname, args, powers, options).then( // This seems to be the only way to propagate the exit code. @@ -287,7 +289,11 @@ const main = async (progname, rawArgs, powers) => { .passThroughOptions(true) .action(async (script, scriptArgs, _options, cmd) => { const opts = { ...program.opts(), ...cmd.opts(), ...cmdOpts, scriptArgs }; - return subMain(runMain, ['run', script], opts); + await runMain(progname, ['run', script], powers, opts); + + if (opts.verbose) { + await statPlans(process.cwd()); + } }); baseCmd('deploy [script...]')