bigpowers 2.87.5 → 2.87.6
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/.gemini/extensions/bigpowers/gemini-extension.json +1 -1
- package/.pi/package.json +1 -1
- package/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/scripts/lib/__pycache__/link_utils.cpython-312.pyc +0 -0
- package/scripts/lib/__pycache__/srp_engine_links.cpython-312.pyc +0 -0
- package/scripts/lib/install-helpers.js +33 -17
package/.pi/package.json
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [2.87.6](https://github.com/danielvm-git/bigpowers/compare/v2.87.5...v2.87.6) (2026-09-01)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **install:** refuse to replace non-managed files or dirs during setup ([#114](https://github.com/danielvm-git/bigpowers/issues/114)) ([f866adc](https://github.com/danielvm-git/bigpowers/commit/f866adca03901fc3a2797e968f866176cf604891)), closes [#112](https://github.com/danielvm-git/bigpowers/issues/112)
|
|
7
|
+
|
|
1
8
|
## [2.87.5](https://github.com/danielvm-git/bigpowers/compare/v2.87.4...v2.87.5) (2026-08-07)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
@@ -19,6 +19,31 @@
|
|
|
19
19
|
const fs = require('fs');
|
|
20
20
|
const path = require('path');
|
|
21
21
|
|
|
22
|
+
// Package root — every link the installer creates points back into this
|
|
23
|
+
// directory, which is how "managed" is detected (see assertReplaceable).
|
|
24
|
+
const REPO_ROOT = path.resolve(__dirname, '..', '..');
|
|
25
|
+
|
|
26
|
+
// Refuse to replace a destination that is not already a bigpowers-managed
|
|
27
|
+
// symlink. Prevents setup from silently destroying a user's own file or
|
|
28
|
+
// directory (e.g. an existing ~/.claude/hooks/rtk-rewrite.sh installed by
|
|
29
|
+
// RTK itself, or a user-authored skills dir with a colliding name). (#112)
|
|
30
|
+
function assertReplaceable(dst) {
|
|
31
|
+
let st;
|
|
32
|
+
try {
|
|
33
|
+
st = fs.lstatSync(dst);
|
|
34
|
+
} catch {
|
|
35
|
+
return; // nothing there — safe to create
|
|
36
|
+
}
|
|
37
|
+
if (st.isSymbolicLink()) {
|
|
38
|
+
const target = fs.readlinkSync(dst);
|
|
39
|
+
if (target.startsWith(REPO_ROOT)) return; // managed by bigpowers — safe to re-link
|
|
40
|
+
}
|
|
41
|
+
throw new Error(
|
|
42
|
+
`Refusing to replace ${dst}: it exists and is not a bigpowers-managed symlink. ` +
|
|
43
|
+
`Back it up or remove it manually, then re-run setup.`
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
22
47
|
function linkSkills(skillsDir, targetDir) {
|
|
23
48
|
for (const entry of fs.readdirSync(skillsDir, { withFileTypes: true })) {
|
|
24
49
|
if (!entry.isDirectory()) continue;
|
|
@@ -27,11 +52,8 @@ function linkSkills(skillsDir, targetDir) {
|
|
|
27
52
|
const src = path.join(skillsDir, entry.name);
|
|
28
53
|
const dst = path.join(targetDir, entry.name);
|
|
29
54
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
fs.rmSync(dst, { force: true, recursive: true });
|
|
33
|
-
} catch {}
|
|
34
|
-
|
|
55
|
+
assertReplaceable(dst);
|
|
56
|
+
fs.rmSync(dst, { force: true });
|
|
35
57
|
fs.symlinkSync(src, dst);
|
|
36
58
|
}
|
|
37
59
|
}
|
|
@@ -42,18 +64,14 @@ function linkDir(src, dst) {
|
|
|
42
64
|
`Link source missing: ${src} (run bash scripts/sync-skills.sh first)`
|
|
43
65
|
);
|
|
44
66
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
fs.rmSync(dst, { force: true, recursive: true });
|
|
48
|
-
} catch {}
|
|
67
|
+
assertReplaceable(dst);
|
|
68
|
+
fs.rmSync(dst, { force: true });
|
|
49
69
|
fs.symlinkSync(src, dst);
|
|
50
70
|
}
|
|
51
71
|
|
|
52
72
|
function linkFile(src, dst) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
fs.rmSync(dst, { force: true });
|
|
56
|
-
} catch {}
|
|
73
|
+
assertReplaceable(dst);
|
|
74
|
+
fs.rmSync(dst, { force: true });
|
|
57
75
|
fs.symlinkSync(src, dst);
|
|
58
76
|
}
|
|
59
77
|
|
|
@@ -82,10 +100,8 @@ function linkHook(src, dst) {
|
|
|
82
100
|
`Hook source missing: ${src} (expected under repo skills/ or scripts/hooks/; fix path or restore file)`
|
|
83
101
|
);
|
|
84
102
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
fs.rmSync(dst, { force: true });
|
|
88
|
-
} catch {}
|
|
103
|
+
assertReplaceable(dst);
|
|
104
|
+
fs.rmSync(dst, { force: true });
|
|
89
105
|
fs.symlinkSync(src, dst);
|
|
90
106
|
try { fs.chmodSync(src, 0o755); } catch {}
|
|
91
107
|
}
|