sync: re-link a local plugin when it was removed from the profile even if its hash is unchanged
This commit is contained in:
1 parent
08202cad67
commit
5dff41a3d0
2 files changed
+8
-1
No files matched your search
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user