|
| 1 | +/** |
| 2 | + * @license |
| 3 | + * Copyright Google Inc. All Rights Reserved. |
| 4 | + * |
| 5 | + * Use of this source code is governed by an MIT-style license that can be |
| 6 | + * found in the LICENSE file at https://angular.io/license |
| 7 | + */ |
| 8 | +import { ArchitectCommand, ArchitectCommandOptions } from '../models/architect-command'; |
| 9 | +import { Arguments } from '../models/interface'; |
| 10 | +import { Schema as DeployCommandSchema } from './deploy'; |
| 11 | + |
| 12 | +const BuilderMissing = ` |
| 13 | +
|
| 14 | +Cannot find "deploy" target for the specified project. |
| 15 | +
|
| 16 | +You should add a package that implements deployment capabilities for your |
| 17 | +favorite platform. |
| 18 | +
|
| 19 | +For example: |
| 20 | + ng add @angular/fire |
| 21 | + ng add @azure/ng-deploy |
| 22 | + ng add @zeit/ng-deploy |
| 23 | +
|
| 24 | +Find more packages on npm https://www.npmjs.com/search?q=ng%20deploy |
| 25 | +`; |
| 26 | + |
| 27 | +export class DeployCommand extends ArchitectCommand<DeployCommandSchema> { |
| 28 | + public readonly target = 'deploy'; |
| 29 | + public readonly missingTargetError = BuilderMissing; |
| 30 | + |
| 31 | + public async run(options: ArchitectCommandOptions & Arguments) { |
| 32 | + return this.runArchitectTarget(options); |
| 33 | + } |
| 34 | + |
| 35 | + public async initialize(options: DeployCommandSchema & Arguments): Promise<void> { |
| 36 | + if (!options.help) { |
| 37 | + return super.initialize(options); |
| 38 | + } |
| 39 | + } |
| 40 | + |
| 41 | + async reportAnalytics( |
| 42 | + paths: string[], |
| 43 | + options: DeployCommandSchema & Arguments, |
| 44 | + dimensions: (boolean | number | string)[] = [], |
| 45 | + metrics: (boolean | number | string)[] = [], |
| 46 | + ): Promise<void> { |
| 47 | + return super.reportAnalytics(paths, options, dimensions, metrics); |
| 48 | + } |
| 49 | +} |
0 commit comments