opencode-immune 1.0.24 → 1.0.25
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/plugin.js +7 -4
- package/package.json +1 -1
package/dist/plugin.js
CHANGED
|
@@ -623,10 +623,12 @@ function extractTarGz(archivePath, destDir) {
|
|
|
623
623
|
* Recursively copy all files from src to dest, creating directories as needed.
|
|
624
624
|
* Overwrites existing files.
|
|
625
625
|
*/
|
|
626
|
-
async function copyDirRecursive(src, dest) {
|
|
626
|
+
async function copyDirRecursive(src, dest, skipFiles) {
|
|
627
627
|
const entries = await (0, promises_1.readdir)(src, { withFileTypes: true });
|
|
628
628
|
await (0, promises_1.mkdir)(dest, { recursive: true });
|
|
629
629
|
for (const entry of entries) {
|
|
630
|
+
if (skipFiles?.has(entry.name))
|
|
631
|
+
continue;
|
|
630
632
|
const srcPath = (0, path_1.join)(src, entry.name);
|
|
631
633
|
const destPath = (0, path_1.join)(dest, entry.name);
|
|
632
634
|
if (entry.isDirectory()) {
|
|
@@ -695,9 +697,10 @@ async function syncHarness(state) {
|
|
|
695
697
|
await (0, promises_1.mkdir)(extractDir, { recursive: true });
|
|
696
698
|
try {
|
|
697
699
|
await extractTarGz(archivePath, extractDir);
|
|
698
|
-
// 6. Copy extracted files to project root
|
|
699
|
-
// The archive contains: opencode.json, .opencode/prompts/**, rules/**, .
|
|
700
|
-
|
|
700
|
+
// 6. Copy extracted files to project root (skip .gitignore — project owns its own)
|
|
701
|
+
// The archive contains: opencode.json, .opencode/prompts/**, rules/**, .opencode/.gitignore
|
|
702
|
+
const SKIP_ROOT_FILES = new Set([".gitignore"]);
|
|
703
|
+
await copyDirRecursive(extractDir, state.input.directory, SKIP_ROOT_FILES);
|
|
701
704
|
// 7. Write version marker
|
|
702
705
|
const versionDir = (0, path_1.join)(state.input.directory, ".opencode");
|
|
703
706
|
await (0, promises_1.mkdir)(versionDir, { recursive: true });
|