@cannbot-ai/install-helper 0.0.2-beta.77 → 0.0.2-beta.78
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/index.js +15 -3
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -2704,12 +2704,24 @@ async function showRestorePrompt(backups) {
|
|
|
2704
2704
|
}
|
|
2705
2705
|
|
|
2706
2706
|
// src/core/plugin-installer.ts
|
|
2707
|
-
import { existsSync as existsSync12, mkdirSync as mkdirSync5, symlinkSync, unlinkSync as unlinkSync4, realpathSync, copyFileSync as copyFileSync2, cpSync, writeFileSync as writeFileSync2, rmSync } from "fs";
|
|
2707
|
+
import { existsSync as existsSync12, mkdirSync as mkdirSync5, symlinkSync, unlinkSync as unlinkSync4, realpathSync, readlinkSync, copyFileSync as copyFileSync2, cpSync, writeFileSync as writeFileSync2, rmSync } from "fs";
|
|
2708
2708
|
import { join as join11, basename } from "path";
|
|
2709
2709
|
import { execa as execa3 } from "execa";
|
|
2710
2710
|
function installLink(source, target) {
|
|
2711
2711
|
try {
|
|
2712
2712
|
const resolved = realpathSync(source);
|
|
2713
|
+
if (isSymlink(target)) {
|
|
2714
|
+
try {
|
|
2715
|
+
const currentTarget = readlinkSync(target);
|
|
2716
|
+
const normCurrent = currentTarget.replace(/\\/g, "/").toLowerCase();
|
|
2717
|
+
const normSource = resolved.replace(/\\/g, "/").toLowerCase();
|
|
2718
|
+
if (normCurrent === normSource) {
|
|
2719
|
+
return "skipped";
|
|
2720
|
+
}
|
|
2721
|
+
} catch {
|
|
2722
|
+
return "skipped";
|
|
2723
|
+
}
|
|
2724
|
+
}
|
|
2713
2725
|
if (existsSync12(target) || isSymlink(target)) {
|
|
2714
2726
|
unlinkSync4(target);
|
|
2715
2727
|
}
|
|
@@ -3161,7 +3173,7 @@ async function installPlugin(opts) {
|
|
|
3161
3173
|
}
|
|
3162
3174
|
|
|
3163
3175
|
// src/core/skill-installer.ts
|
|
3164
|
-
import { existsSync as existsSync14, mkdirSync as mkdirSync6, symlinkSync as symlinkSync2, unlinkSync as unlinkSync5, readdirSync as readdirSync4, rmSync as rmSync2, realpathSync as realpathSync2, readlinkSync } from "fs";
|
|
3176
|
+
import { existsSync as existsSync14, mkdirSync as mkdirSync6, symlinkSync as symlinkSync2, unlinkSync as unlinkSync5, readdirSync as readdirSync4, rmSync as rmSync2, realpathSync as realpathSync2, readlinkSync as readlinkSync2 } from "fs";
|
|
3165
3177
|
import { join as join13, dirname as dirname6, isAbsolute } from "path";
|
|
3166
3178
|
import { select as select3, checkbox, Separator as Separator2 } from "@inquirer/prompts";
|
|
3167
3179
|
import chalk5 from "chalk";
|
|
@@ -3191,7 +3203,7 @@ async function installSkills(skillIds, tool, level, repoPath) {
|
|
|
3191
3203
|
const resolvedSource = realpathSync2(sourcePath);
|
|
3192
3204
|
if (isSymlink(targetPath)) {
|
|
3193
3205
|
try {
|
|
3194
|
-
const currentTarget =
|
|
3206
|
+
const currentTarget = readlinkSync2(targetPath);
|
|
3195
3207
|
const normCurrent = currentTarget.replace(/\\/g, "/").toLowerCase();
|
|
3196
3208
|
const normSource = resolvedSource.replace(/\\/g, "/").toLowerCase();
|
|
3197
3209
|
if (normCurrent === normSource) {
|