diff --git a/packages/angular/cli/utilities/json-schema.ts b/packages/angular/cli/utilities/json-schema.ts index cb6387e818d6..ba7dc9fc4c2b 100644 --- a/packages/angular/cli/utilities/json-schema.ts +++ b/packages/angular/cli/utilities/json-schema.ts @@ -151,26 +151,23 @@ export async function parseJsonSchemaToOptions( } let defaultValue: string | number | boolean | undefined = undefined; - if (schema.default !== undefined) { + if (current.default !== undefined) { switch (types[0]) { case 'string': - if (typeof schema.default == 'string') { - defaultValue = schema.default; + if (typeof current.default == 'string') { + defaultValue = current.default; } break; case 'number': - if (typeof schema.default == 'number') { - defaultValue = schema.default; + if (typeof current.default == 'number') { + defaultValue = current.default; } break; case 'boolean': - if (typeof schema.default == 'boolean') { - defaultValue = schema.default; + if (typeof current.default == 'boolean') { + defaultValue = current.default; } break; - - default: - console.log(types[0], schema); } } diff --git a/tests/legacy-cli/e2e/tests/generate/help-output.ts b/tests/legacy-cli/e2e/tests/generate/help-output.ts index c1b9f69c4b2f..0b2f8607ca6c 100644 --- a/tests/legacy-cli/e2e/tests/generate/help-output.ts +++ b/tests/legacy-cli/e2e/tests/generate/help-output.ts @@ -88,7 +88,7 @@ export default function() { .then(() => ng('generate', 'fake', '--help')) // verify same output .then(({stdout}) => { - if (!/ng generate fake-schematics:fake \[options\]/.test(stdout)) { + if (!/ng generate fake \[options\]/.test(stdout)) { throw new Error('Help signature is wrong (2).'); } if (!/opt-a[\s\S]*opt-b[\s\S]*opt-c/.test(stdout)) {