1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.NewCommand = void 0;
|
4 | const schematic_command_1 = require("../models/schematic-command");
|
5 | class NewCommand extends schematic_command_1.SchematicCommand {
|
6 | constructor() {
|
7 | super(...arguments);
|
8 | this.allowMissingWorkspace = true;
|
9 | this.schematicName = 'ng-new';
|
10 | }
|
11 | async initialize(options) {
|
12 | this.collectionName = options.collection || await this.getDefaultSchematicCollection();
|
13 | return super.initialize(options);
|
14 | }
|
15 | async run(options) {
|
16 |
|
17 | const packageJson = require('../package.json');
|
18 | const version = packageJson.version;
|
19 | this._workflow.registry.addSmartDefaultProvider('ng-cli-version', () => version);
|
20 | return this.runSchematic({
|
21 | collectionName: this.collectionName,
|
22 | schematicName: this.schematicName,
|
23 | schematicOptions: options['--'] || [],
|
24 | debug: !!options.debug,
|
25 | dryRun: !!options.dryRun,
|
26 | force: !!options.force,
|
27 | });
|
28 | }
|
29 | }
|
30 | exports.NewCommand = NewCommand;
|