Skip to content

Commit

Permalink
fix(@angular-devkit/schematics): use correct command on yarn
Browse files Browse the repository at this point in the history
  • Loading branch information
clydin authored and hansl committed Jun 6, 2018
1 parent 130b260 commit b63ce3e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions packages/angular_devkit/schematics/tasks/node-package/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,22 @@ import { NodePackageTaskFactoryOptions, NodePackageTaskOptions } from './options

type PackageManagerProfile = {
quietArgument?: string;
commands: { [name: string]: string },
};

const packageManagers: { [name: string]: PackageManagerProfile } = {
'npm': {
quietArgument: '--quiet',
commands: { },
},
'cnpm': { },
'cnpm': {
commands: { },
},
'yarn': {
quietArgument: '--silent',
commands: {
'install': 'add',
},
},
};

Expand Down Expand Up @@ -61,7 +68,9 @@ export default function(
shell: true,
cwd: path.join(rootDirectory, options.workingDirectory || ''),
};
const args = [ options.command ];
const args = [
taskPackageManagerProfile.commands[options.command] || options.command,
];

if (options.packageName) {
args.push(options.packageName);
Expand Down

0 comments on commit b63ce3e

Please sign in to comment.