angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

ng generate is not respecting --dry-run flag

Open rageshvr opened this issue 9 years ago • 4 comments

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?

rageshvr avatar Jun 26 '17 17:06 rageshvr

Thanks for the report, this sounds like a regression.

@Brocco related (and possibly duplicate) of https://github.com/angular/angular-cli/issues/6735.

filipesilva avatar Jun 27 '17 13:06 filipesilva

He's right. I have reproduced that. #GoodnessSquad

okozolin avatar Jul 19 '17 18:07 okozolin

Fixed with Schematics.

hansl avatar Aug 17 '17 23:08 hansl

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.