safeword 0.30.2 → 0.30.3

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.
@@ -6,7 +6,7 @@ import {
6
6
  createProjectContext,
7
7
  getMissingPacks,
8
8
  reconcile
9
- } from "./chunk-VKYVBKM6.js";
9
+ } from "./chunk-A52DHYLS.js";
10
10
  import "./chunk-YVZL7WO5.js";
11
11
  import {
12
12
  VERSION
@@ -189,4 +189,4 @@ async function check(options) {
189
189
  export {
190
190
  check
191
191
  };
192
- //# sourceMappingURL=check-KU5QI4TK.js.map
192
+ //# sourceMappingURL=check-VBN3JZIG.js.map
@@ -507,14 +507,11 @@ function planMissingDirectories(directories, cwd, isGitRepo2) {
507
507
  }
508
508
  return { actions, created };
509
509
  }
510
- function planTextPatches(patches, cwd, isGitRepo2) {
510
+ function planTextPatches(patches, isGitRepo2) {
511
511
  const actions = [];
512
512
  for (const [filePath, definition] of Object.entries(patches)) {
513
513
  if (shouldSkipForNonGit(filePath, isGitRepo2)) continue;
514
- const content = readFileSafe(nodePath7.join(cwd, filePath)) ?? "";
515
- if (!content.includes(definition.marker)) {
516
- actions.push({ type: "text-patch", path: filePath, definition });
517
- }
514
+ actions.push({ type: "text-patch", path: filePath, definition });
518
515
  }
519
516
  return actions;
520
517
  }
@@ -537,11 +534,10 @@ function planManagedFileWrites(files, ctx) {
537
534
  return planFileWrites(files, ctx, (filePath, c) => exists(nodePath7.join(c.cwd, filePath)));
538
535
  }
539
536
  function planTextPatchesWithCreation(patches, ctx) {
540
- const actions = [];
537
+ const actions = planTextPatches(patches, ctx.isGitRepo);
541
538
  const created = [];
542
539
  for (const [filePath, definition] of Object.entries(patches)) {
543
540
  if (shouldSkipForNonGit(filePath, ctx.isGitRepo)) continue;
544
- actions.push({ type: "text-patch", path: filePath, definition });
545
541
  if (definition.createIfMissing && !exists(nodePath7.join(ctx.cwd, filePath))) {
546
542
  created.push(filePath);
547
543
  }
@@ -717,7 +713,7 @@ function computeUpgradePlan(schema, ctx) {
717
713
  for (const [filePath, definition] of Object.entries(schema.jsonMerges)) {
718
714
  actions.push({ type: "json-merge", path: filePath, definition });
719
715
  }
720
- actions.push(...planTextPatches(schema.textPatches, ctx.cwd, ctx.isGitRepo));
716
+ actions.push(...planTextPatches(schema.textPatches, ctx.isGitRepo));
721
717
  const packagesToInstall = computePackagesToInstall(
722
718
  schema,
723
719
  ctx.projectType,
@@ -3022,4 +3018,4 @@ export {
3022
3018
  detectLanguages2,
3023
3019
  createProjectContext
3024
3020
  };
3025
- //# sourceMappingURL=chunk-VKYVBKM6.js.map
3021
+ //# sourceMappingURL=chunk-A52DHYLS.js.map