diff --git a/index.js b/index.js index 3336ff8..8ff1a6d 100644 --- a/index.js +++ b/index.js @@ -495,7 +495,7 @@ export function apply(ctx, config = {}) { if (!sync.allowed(b.name, local)) { result.skipped.push(`${b.name} (local deny/allow)`); continue } try { if (b.kind === 'local') { - if (prev[b.name]?.hash === b.hash) { next[b.name] = prev[b.name]; continue } + if (prev[b.name]?.hash === b.hash && sync.isLinked(b.name, prev[b.name].dir)) { next[b.name] = prev[b.name]; continue } const stream = mux.open('blob', { name: b.name }) const buf = await new Promise((resolve, reject) => { const parts = [] diff --git a/lib/sync.mjs b/lib/sync.mjs index 01030c6..9e7921d 100644 --- a/lib/sync.mjs +++ b/lib/sync.mjs @@ -285,6 +285,13 @@ export function allowed(name, { allow = [], deny = [] } = {}) { return true } +/** True when the profile still lists `name` as a bundle linked to `dir` (survives manual edits). */ +export function isLinked(name, dir) { + const pkg = readJson(path.join(profileDir(), 'package.json')) + if (!pkg || !dir || !fs.existsSync(dir)) return false + return pkg.dependencies?.[name] === `link:${dir}` && (pkg.dsh?.profile?.bundles || []).includes(name) +} + /** Link-spec install of a local plugin dir into the profile (package.json + bundles list). */ export function linkLocalBundle(name, dir) { const prof = profileDir()