Example #1
0
 return tslib_1.__awaiter(this, void 0, void 0, function* () {
     yield this.checkForOpenSSH();
     const config = yield this.env.config.load();
     yield this.env.session.getUserToken();
     if (!options['annotation']) {
         options['annotation'] = config.user.email;
     }
     lib_1.validate(String(options['type']), 'type', [lib_1.contains(SSH_KEY_TYPES, { caseSensitive: false })]);
 });
Example #2
0
 return tslib_1.__awaiter(this, void 0, void 0, function* () {
     const [id] = inputs;
     const { detectAndTreatAilment, registry, treatAilments } = yield Promise.resolve().then(() => require('@ionic/cli-utils/lib/doctor/index'));
     const { Ailments } = yield Promise.resolve().then(() => require('@ionic/cli-utils/lib/doctor/ailments'));
     const ailmentIds = Ailments.ALL.map(Ailment => new Ailment().id);
     if (id) {
         lib_1.validate(id, 'id', [lib_1.contains(ailmentIds, {})]);
         const ailment = registry.get(id);
         if (!ailment) {
             throw new errors_1.FatalException(`Issue not found by ID: ${chalk_1.default.green(id)}`);
         }
         yield detectAndTreatAilment(this.env, ailment);
     }
     else {
         yield treatAilments(this.env);
     }
 });
Example #3
0
 return tslib_1.__awaiter(this, void 0, void 0, function* () {
     yield this.preRunChecks();
     if (options['r'] || options['noresources']) {
         options['resources'] = false;
     }
     inputs[0] = (typeof inputs[0] === 'undefined') ? 'ls' : inputs[0];
     inputs[0] = (inputs[0] === 'rm') ? 'remove' : inputs[0];
     inputs[0] = (inputs[0] === 'list') ? 'ls' : inputs[0];
     lib_1.validate(inputs[0], 'action', [lib_1.contains(['add', 'remove', 'update', 'ls', 'check', 'save'], {})]);
     // If the action is list, check, or save, then just end here.
     if (['ls', 'check', 'save'].includes(inputs[0])) {
         yield this.runCordova(['platform', inputs[0]], { showExecution: true });
         throw new errors_1.FatalException('', 0);
     }
     if (!inputs[1]) {
         const platform = yield this.env.prompt({
             type: 'input',
             name: 'platform',
             message: `What platform would you like to ${inputs[0]} (${['android', 'ios'].map(v => chalk_1.default.green(v)).join(', ')}):`,
         });
         inputs[1] = platform.trim();
     }
     lib_1.validate(inputs[1], 'platform', [lib_1.validators.required]);
 });