Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/angular/cli/commands/add-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const npa = require('npm-package-arg');

export class AddCommand extends SchematicCommand<AddCommandSchema> {
readonly allowPrivateSchematics = true;
readonly allowAdditionalArgs = true;
readonly packageManager = getPackageManager(this.workspace.root);

async run(options: AddCommandSchema & Arguments) {
Expand Down
3 changes: 2 additions & 1 deletion packages/angular/cli/models/schematic-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export abstract class SchematicCommand<
T extends (BaseSchematicSchema & BaseCommandOptions),
> extends Command<T> {
readonly allowPrivateSchematics: boolean = false;
readonly allowAdditionalArgs: boolean = false;
private _host = new NodeJsSyncHost();
private _workspace: experimental.workspace.Workspace;
private readonly _engine: Engine<FileSystemCollectionDesc, FileSystemSchematicDesc>;
Expand Down Expand Up @@ -438,7 +439,7 @@ export abstract class SchematicCommand<
}

// ng-add is special because we don't know all possible options at this point
if (args['--'] && schematicName !== 'ng-add') {
if (args['--'] && !this.allowAdditionalArgs) {
args['--'].forEach(additional => {
this.logger.fatal(`Unknown option: '${additional.split(/=/)[0]}'`);
});
Expand Down