@drzl/cli 4.24.3 → 4.24.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.cjs CHANGED
@@ -2866,6 +2866,8 @@ var EmitPlan = class {
2866
2866
  constructor(options) {
2867
2867
  this.byFile = /* @__PURE__ */ new Map();
2868
2868
  this.dirs = /* @__PURE__ */ new Set();
2869
+ /** Paths this run has actually put bytes on disk for, which is not every path it recorded. */
2870
+ this.wrote = /* @__PURE__ */ new Set();
2869
2871
  this.writes = options.write;
2870
2872
  this.existing = options.existing;
2871
2873
  }
@@ -2882,7 +2884,11 @@ var EmitPlan = class {
2882
2884
  after: contents,
2883
2885
  verdict: before === null ? "created" : before === contents ? "unchanged" : "changed"
2884
2886
  });
2885
- if (this.writes) await import_node_fs2.promises.writeFile(file, contents, "utf8");
2887
+ if (!this.writes) return;
2888
+ const onDisk = prior ? this.wrote.has(file) ? prior.after : prior.before : before;
2889
+ if (onDisk === contents) return;
2890
+ await import_node_fs2.promises.writeFile(file, contents, "utf8");
2891
+ this.wrote.add(file);
2886
2892
  }
2887
2893
  async read(file) {
2888
2894
  if (this.existing) return this.existing.get(file) ?? null;