UNPKG

ionic

Version:

A tool for creating and developing Ionic Framework mobile apps.

31 lines (30 loc) 1.09 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const build_1 = require("../../build"); const color_1 = require("../../color"); const errors_1 = require("../../errors"); class CustomBuildRunner extends build_1.BuildRunner { constructor(e) { super(); this.e = e; } async getCommandMetadata() { return {}; } createOptionsFromCommandLine(inputs, options) { const baseOptions = super.createBaseOptionsFromCommandLine(inputs, options); return { ...baseOptions, type: 'custom', }; } async buildProject(options) { const cli = this.getPkgManagerBuildCLI(); if (!await cli.resolveScript()) { throw new errors_1.RunnerException(`Cannot perform build.\n` + `Since you're using the ${color_1.strong('custom')} project type, you must provide the ${color_1.input(cli.script)} npm script so the Ionic CLI can build your project.`); } await cli.build(options); } } exports.CustomBuildRunner = CustomBuildRunner;