@fern-api/replay 0.10.1 → 0.10.2
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 +8 -3
- package/dist/cli.cjs.map +1 -1
- package/dist/index.cjs +8 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -15520,9 +15520,10 @@ var ReplayApplicator = class {
|
|
|
15520
15520
|
const resolvedPath = await this.resolveFilePath(filePath, baseGen.tree_hash, currentTreeHash);
|
|
15521
15521
|
const base = await this.git.showFile(baseGen.tree_hash, filePath);
|
|
15522
15522
|
const theirs = await this.applyPatchToContent(base, patch.patch_content, filePath, tempGit, tempDir);
|
|
15523
|
-
|
|
15523
|
+
const effectiveTheirs = theirs ?? await (0, import_promises.readFile)((0, import_node_path3.join)(this.outputDir, resolvedPath), "utf-8").catch(() => null);
|
|
15524
|
+
if (effectiveTheirs) {
|
|
15524
15525
|
this.fileTheirsAccumulator.set(resolvedPath, {
|
|
15525
|
-
content:
|
|
15526
|
+
content: effectiveTheirs,
|
|
15526
15527
|
baseGeneration: patch.base_generation
|
|
15527
15528
|
});
|
|
15528
15529
|
}
|
|
@@ -15566,8 +15567,12 @@ var ReplayApplicator = class {
|
|
|
15566
15567
|
};
|
|
15567
15568
|
} catch {
|
|
15568
15569
|
for (const [resolvedPath, content] of snapshots) {
|
|
15570
|
+
const fullPath = (0, import_node_path3.join)(this.outputDir, resolvedPath);
|
|
15569
15571
|
if (content != null) {
|
|
15570
|
-
await (0, import_promises.writeFile)(
|
|
15572
|
+
await (0, import_promises.writeFile)(fullPath, content);
|
|
15573
|
+
} else {
|
|
15574
|
+
await (0, import_promises.unlink)(fullPath).catch(() => {
|
|
15575
|
+
});
|
|
15571
15576
|
}
|
|
15572
15577
|
}
|
|
15573
15578
|
}
|