cc-zos
Version:
Command-line interface for the ZeppelinOS smart contract platform
43 lines (29 loc) • 1.46 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
var _status = require('../scripts/status');
var _status2 = _interopRequireDefault(_status);
var _pull = require('../scripts/pull');
var _pull2 = _interopRequireDefault(_pull);
var _compare = require('../scripts/compare');
var _compare2 = _interopRequireDefault(_compare);
var _runWithTruffle = require('../utils/runWithTruffle');
var _runWithTruffle2 = _interopRequireDefault(_runWithTruffle);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const name = 'status';
const signature = name;
const description = 'print information about the local status of your app in a specific network';
const register = program => program.command(signature, { noHelp: true }).description(description).usage('--network <network>').option('--fetch', 'retrieve app information directly from the network instead of from the local network file').option('--fix', 'update local network file with information retrieved from the network').withNetworkOptions().action(action);
async function action(options) {
await (0, _runWithTruffle2.default)(async opts => {
if (options.fix) {
await (0, _pull2.default)(opts);
} else if (options.fetch) {
await (0, _compare2.default)(opts);
} else {
await (0, _status2.default)(opts);
}
}, options);
}
exports.default = { name, signature, description, register, action };