Skip to content

Commit

Permalink
fix(angular): convert --no-<opt> to --<opt>=false for ng
Browse files Browse the repository at this point in the history
This allows for boolean options such as `--create-module=false` to be
specified as `--no-create-module`, which is more aligned with the Ionic
CLI style options.
  • Loading branch information
imhoffd committed Mar 25, 2020
1 parent 6baeba9 commit 176ff4b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/@ionic/cli/src/lib/project/angular/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,15 @@ To test a generator before file modifications are made, use the ${input('--dry-r
}

private async generateComponent(type: string, name: string, options: { [key: string]: string | boolean; }) {
const args = {
_: ['generate', type, name],
// convert `--no-<opt>` style options to `--<opt>=false`
...lodash.mapValues(options, v => v === false ? 'false' : v),
};

await this.e.shell.run(
'ng',
unparseArgs({ _: ['generate', type, name], ...options }, {}),
unparseArgs(args, { useEquals: true }),
{ cwd: this.e.ctx.execPath, stdio: 'inherit' }
);
}
Expand Down

0 comments on commit 176ff4b

Please sign in to comment.