-
Notifications
You must be signed in to change notification settings - Fork 12k
Boolean options not parsed correctly on schematics cli #12150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Any news about this? |
How about using The patch will be as follows. diff --git a/packages/angular_devkit/core/src/json/schema/registry.ts b/packages/angular_devkit/core/src/json/schema/registry.ts
index 06321af8..5638fa08 100644
--- a/packages/angular_devkit/core/src/json/schema/registry.ts
+++ b/packages/angular_devkit/core/src/json/schema/registry.ts
@@ -115,6 +115,7 @@ export class CoreSchemaRegistry implements SchemaRegistry {
loadSchema: (uri: string) => this._fetch(uri),
schemaId: 'auto',
passContext: true,
+ coerceTypes: true
});
this._ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-04.json')); |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
From @TinyMan on January 14, 2018 17:11
Bug Report or Feature Request (mark with an
x
)Area
Versions
Repro steps
The log given by the failure
Desired functionality
Boolean options should be parsed.
Right now it is true if only
--routing
is specified but it fails with--routing false
or--routing true
.For
--routing
option it is not really a problem because by default it isfalse
: we can set it totrue
with--routing
.However it is blocking for custom schematics with boolean option that defaults to
true
: we can't set it tofalse
.Mention any other details that might be useful
Only the arguments specified here are parsed as booleans:
https://github.com/angular/devkit/blob/c88d991344a910903c2178b537a919c9da2de03f/packages/angular_devkit/schematics_cli/bin/schematics.ts#L102
After this
minimist
assigns the string "true" or "false" to the option hence the error.Copied from original issue: angular/devkit#393
The text was updated successfully, but these errors were encountered: