Skip to content
Merged
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
4 changes: 3 additions & 1 deletion packages/angular/cli/src/commands/add/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ interface AddCommandArgs extends SchematicsCommandArgs {

interface AddCommandTaskContext {
packageIdentifier: npa.Result;
isExactVersion: boolean;
savePackage?: NgAddSaveDependency;
collectionName?: string;
executeSchematic: AddCommandModule['executeSchematic'];
Expand Down Expand Up @@ -188,6 +189,7 @@ export default class AddCommandModule

const taskContext = {
packageIdentifier,
isExactVersion: packageIdentifier.type === 'version',
executeSchematic: this.executeSchematic.bind(this),
getPeerDependencyConflicts: this.getPeerDependencyConflicts.bind(this),
dryRun: options.dryRun,
Expand Down Expand Up @@ -515,7 +517,7 @@ export default class AddCommandModule
context.packageIdentifier.name,
// `save-prefix` option is ignored by some package managers so the caret is needed to ensure
// that the value in the project package.json is correct.
'^' + manifest.version,
(context.isExactVersion ? '' : '^') + manifest.version,
);
}

Expand Down