How to use the @ionic/cli.TaskChain function in @ionic/cli

To help you get started, we’ve selected a few @ionic/cli examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ionic-team / ionic-cli / packages / cli-plugin-cloud / src / commands / ssh / generate.ts View on Github external
async run(inputs: CommandLineInputs, options: CommandLineOptions): Promise {
    const keyPath = path.resolve(options['key-path'] ? String(options['key-path']) : 'id_rsa');
    const pubkeyPath = path.resolve(options['pubkey-path'] ? String(options['pubkey-path']) : 'id_rsa.pub');

    const tasks = new TaskChain();

    tasks.next('generating ssh keys');

    const req = this.env.client.make('POST', '/apps/sshkeys/generate').send({});
    const res = await this.env.client.do(req);

    if (!isSSHGenerateResponse(res)) {
      throw 'todo'; // TODO
    }

    tasks.next('writing ssh keys');

    await Promise.all([
      fsWriteFile(keyPath, res.data.key),
      fsWriteFile(pubkeyPath, res.data.pubkey)
    ]);

@ionic/cli

A tool for creating and developing Ionic Framework mobile apps.

MIT
Latest version published 12 months ago

Package Health Score

66 / 100
Full package analysis