{"record":{"id":"11cf07c5f6216a71","repo":"angular/angular-cli","slug":"note-the-dry-run-option-means-no-changes-wer","errorCode":null,"errorMessage":"\nNOTE: The \"--dry-run\" option means no changes were made.","messagePattern":"\nNOTE: The \"--dry-run\" option means no changes were made\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"packages/angular/cli/src/command-builder/schematics-command-module.ts","lineNumber":364,"sourceCode":"    const { unsubscribe, files } = subscribeToWorkflow(workflow, logger);\n\n    try {\n      await workflow\n        .execute({\n          collection: collectionName,\n          schematic: schematicName,\n          options: schematicOptions,\n          logger,\n          allowPrivate: this.allowPrivateSchematics,\n        })\n        .toPromise();\n\n      if (!files.size) {\n        logger.info('Nothing to be done.');\n      }\n\n      if (executionOptions.dryRun) {\n        logger.warn(`\\nNOTE: The \"--dry-run\" option means no changes were made.`);\n\n        return 0;\n      }\n\n      if (files.size) {\n        // Note: we could use a task executor to format the files but this is simpler.\n        try {\n          await formatFiles(this.context.root, files);\n        } catch (error) {\n          assertIsError(error);\n\n          logger.warn(\n            `WARNING: Formatting of files failed with the following error: ${error.message}`,\n          );\n        }\n      }\n\n      return 0;","sourceCodeStart":346,"sourceCodeEnd":382,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular/cli/src/command-builder/schematics-command-module.ts#L346-L382","documentation":"In runSchematic, after a schematic executes with the --dry-run option, the CLI logs a warning clarifying that because dry-run mode was active no files were actually modified. This is informational, not a failure; the command returns 0.","triggerScenarios":"Running `ng generate ... --dry-run` or `ng new --dry-run` where the schematic would have created/modified files (files.size > 0) but executionOptions.dryRun was true.","commonSituations":"Previewing a generator before committing changes (`ng g component --dry-run`); CI scripts that run schematics in dry-run mode to validate templates; users confused why nothing changed on disk.","solutions":["No fix needed — expected behavior. Re-run without `--dry-run` to apply the changes.","If changes should be applied in automation, remove the --dry-run flag from the command."],"exampleFix":"// before (preview only)\nng g component hero --dry-run\n// after (actually writes files)\nng g component hero","handlingStrategy":"validation","validationCode":"if (process.argv.includes('--dry-run') && autoApplyExpected) {\n  console.warn('Refusing to run: --dry-run prevents file writes.');\n  process.exit(1);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remove --dry-run from commands intended to write files.","In CI, assert the dry-run preview output matches expectations before running for real."],"tags":["angular-cli","schematics","dry-run"],"backgroundTag":"dry-run-no-changes","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}