Skip to content

Commit 6e73600

Browse files
clydinBrocco
authored andcommitted
fix(@angular-devkit/schematics): use correct command on yarn
1 parent 709fd48 commit 6e73600

File tree

1 file changed

+11
-2
lines changed
  • packages/angular_devkit/schematics/tasks/node-package

1 file changed

+11
-2
lines changed

packages/angular_devkit/schematics/tasks/node-package/executor.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,22 @@ import { NodePackageTaskFactoryOptions, NodePackageTaskOptions } from './options
1414

1515
type PackageManagerProfile = {
1616
quietArgument?: string;
17+
commands: { [name: string]: string },
1718
};
1819

1920
const packageManagers: { [name: string]: PackageManagerProfile } = {
2021
'npm': {
2122
quietArgument: '--quiet',
23+
commands: { },
2224
},
23-
'cnpm': { },
25+
'cnpm': {
26+
commands: { },
27+
},
2428
'yarn': {
2529
quietArgument: '--silent',
30+
commands: {
31+
'install': 'add',
32+
},
2633
},
2734
};
2835

@@ -61,7 +68,9 @@ export default function(
6168
shell: true,
6269
cwd: path.join(rootDirectory, options.workingDirectory || ''),
6370
};
64-
const args = [ options.command ];
71+
const args = [
72+
taskPackageManagerProfile.commands[options.command] || options.command,
73+
];
6574

6675
if (options.packageName) {
6776
args.push(options.packageName);

0 commit comments

Comments
 (0)