@newos/cli
Version:
Command-line interface for the NewOS
31 lines • 1.48 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const accounts_1 = __importDefault(require("../scripts/accounts"));
const prompt_1 = require("../prompts/prompt");
const ConfigManager_1 = __importDefault(require("../models/config/ConfigManager"));
const telemetry_1 = __importDefault(require("../telemetry"));
const name = 'accounts';
const signature = name;
const description = 'list the accounts of the selected network';
const register = program => program
.command(signature, undefined, { noHelp: true })
.description(description)
.withNetworkOptions()
.withNonInteractiveOption()
.action(action);
async function action(options) {
const networkOpts = await prompt_1.promptForNetwork(options, () => getCommandProps());
const { network } = await ConfigManager_1.default.initNetworkConfiguration(Object.assign(Object.assign({}, options), networkOpts));
await telemetry_1.default.report('accounts', { network }, options.interactive);
await accounts_1.default({ network });
if (!options.dontExitProcess && process.env.NODE_ENV !== 'test')
process.exit(0);
}
function getCommandProps() {
return Object.assign({}, prompt_1.networksList('network', 'list'));
}
exports.default = { name, signature, description, register, action };
//# sourceMappingURL=accounts.js.map