ng generate is not respecting --dry-run flag
Bug Report or Feature Request (mark with an x)
- [x ] bug report -> please search issues before submitting
- [ ] feature request
Versions.
@angular/cli: 1.1.3 node: 7.2.1 os: win32 x64 @angular/animations: 4.2.4 @angular/common: 4.2.4 @angular/compiler: 4.2.4 @angular/core: 4.2.4 @angular/flex-layout: 2.0.0-beta.8 @angular/forms: 4.2.4 @angular/http: 4.2.4 @angular/material: 2.0.0-beta.7 @angular/platform-browser: 4.2.4 @angular/platform-browser-dynamic: 4.2.4 @angular/router: 4.2.4 @angular/cli: 1.1.3 @angular/compiler-cli: 4.2.4 @angular/language-service: 4.2.4
Repro steps.
ng new my-app -sg -sc
cd my-app\src\app
ng g m material --module=app --dry-run
The log given by the failure.
Above ng generate outputs:
installing module
You specified the dry-run flag, so no changes will be written.
create src\app\material\material.module.ts
update src\app\app.module.ts
Desired functionality.
ng generate with --dry-run should not create / update any files to the disk. Above command with --dry-run updated app.module.ts with the import statement and the module added to the imports array.
import { MaterialModule } from './material/material.module';
...
imports: [
BrowserModule,
MaterialModule
],
Mention any other details that might be useful.
Guess #921 is broken?
Thanks for the report, this sounds like a regression.
@Brocco related (and possibly duplicate) of https://github.com/angular/angular-cli/issues/6735.
He's right. I have reproduced that. #GoodnessSquad
Fixed with Schematics.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.