Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const cordovalogws = createPrefixedWriteStream(this.env.log, weak(`[cordova]`));
const buildOpts: IShellRunOptions = { stream: cordovalogws };
// ignore very verbose compiler output on stdout unless --verbose
buildOpts.stdio = options['verbose'] ? 'inherit' : ['pipe', 'ignore', 'pipe'];
if (options['native-run']) {
const [ platform ] = inputs;
const packagePath = await getPackagePath(conf.getProjectInfo().name, platform, { emulator: !options['device'], release: !!options['release'] });
const forwardedPorts = details ? runner.getUsedPorts(runnerOpts, details) : [];
await this.runCordova(filterArgumentsForCordova({ ...metadata, name: 'build' }, options), buildOpts);
await this.runNativeRun(createNativeRunArgs({ packagePath, platform, forwardedPorts }, options));
} else {
await this.runCordova(filterArgumentsForCordova(metadata, options), buildOpts);
await sleepForever();
}
}
if (!cordova) {
await runCommand(runinfo, ['integrations', 'enable', 'cordova']);
}
}
await runner.run(runnerOpts);
} catch (e) {
if (e instanceof RunnerException) {
throw new FatalException(e.message);
}
throw e;
}
await sleepForever();
}
}
this.env.log.info(
'Ready for use in your Native IDE!\n' +
`To continue, run your project on a device or ${platform === 'ios' ? 'simulator' : 'emulator'} using ${platform === 'ios' ? 'Xcode' : 'Android Studio'}!`
);
this.env.log.nl();
await this.runCapacitor(['open', platform]);
if (options['livereload']) {
this.env.log.nl();
this.env.log.info(
'Development server will continue running until manually stopped.\n' +
chalk.yellow('Use Ctrl+C to quit this process')
);
await sleepForever();
}
}