Skip to content

Commit 872737b

Browse files
sarunintBrocco
authored andcommitted
fix(@angular/cli): supress module file modification when generating guard with dry-run flag
1 parent 2f9e1f8 commit 872737b

File tree

1 file changed

+7
-0
lines changed
  • packages/@angular/cli/blueprints/guard

1 file changed

+7
-0
lines changed

packages/@angular/cli/blueprints/guard/index.ts

+7
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,13 @@ export default Blueprint.extend({
9999
`;
100100
this._writeStatusToUI(chalk.yellow, 'WARNING', warningMessage);
101101
} else {
102+
if (options.dryRun) {
103+
this._writeStatusToUI(chalk.yellow,
104+
'update',
105+
path.relative(this.project.root, this.pathToModule));
106+
return;
107+
}
108+
102109
const className = stringUtils.classify(`${options.entity.name}Guard`);
103110
const fileName = stringUtils.dasherize(`${options.entity.name}.guard`);
104111
const fullGeneratePath = path.join(this.project.root, this.generatePath);

0 commit comments

Comments
 (0)