mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 17:50:45 +00:00
fix(upgrade): unlink stale plugin runtime symlinks
This commit is contained in:
@@ -445,6 +445,7 @@ function collectLegacyPluginRuntimeDepsSymlinkPaths(roots, params = {}) {
|
||||
export function pruneLegacyPluginRuntimeDepsState(params = {}) {
|
||||
const pathExists = params.existsSync ?? existsSync;
|
||||
const removePath = params.rmSync ?? rmSync;
|
||||
const unlinkPath = params.unlinkSync ?? unlinkSync;
|
||||
const log = params.log ?? console;
|
||||
const removed = [];
|
||||
const removedSymlinks = [];
|
||||
@@ -452,7 +453,7 @@ export function pruneLegacyPluginRuntimeDepsState(params = {}) {
|
||||
|
||||
for (const linkPath of collectLegacyPluginRuntimeDepsSymlinkPaths(roots, params)) {
|
||||
try {
|
||||
removePath(linkPath, { force: true });
|
||||
unlinkPath(linkPath);
|
||||
removedSymlinks.push(linkPath);
|
||||
} catch (error) {
|
||||
log.warn?.(
|
||||
@@ -889,7 +890,10 @@ export function runBundledPluginPostinstall(params = {}) {
|
||||
env,
|
||||
packageRoot,
|
||||
existsSync: pathExists,
|
||||
lstatSync: params.lstatSync,
|
||||
readlinkSync: params.readlinkSync,
|
||||
rmSync: params.rmSync,
|
||||
unlinkSync: params.unlinkSync,
|
||||
log,
|
||||
homedir: params.homedir,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user