mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-16 10:15:10 +00:00
fix(management): skip broken shared plugin entries
This commit is contained in:
1 parent
c21f589247
commit
f44b651cd6
2 files changed
+38
-1
No files matched your search
@@ -307,6 +307,31 @@ describe('SharedManager', () => {
|
||||
});
|
||||
|
||||
describe('marketplace registry ownership', () => {
|
||||
it('skips unstatable shared plugin entries during instance linking', () => {
|
||||
const manager = new SharedManager();
|
||||
const instancePath = instanceDir('work');
|
||||
const sharedPluginsPath = path.join(claudeDir(), 'plugins');
|
||||
const logSpy = spyOn(console, 'log').mockImplementation(() => {});
|
||||
|
||||
fs.mkdirSync(instancePath, { recursive: true });
|
||||
fs.mkdirSync(sharedPluginsPath, { recursive: true });
|
||||
fs.symlinkSync(
|
||||
path.join(sharedPluginsPath, 'missing-plugin'),
|
||||
path.join(sharedPluginsPath, 'broken-plugin'),
|
||||
'dir'
|
||||
);
|
||||
|
||||
expect(() => manager.linkSharedDirectories(instancePath)).not.toThrow();
|
||||
expect(fs.existsSync(path.join(instancePath, 'plugins', 'broken-plugin'))).toBe(false);
|
||||
expect(
|
||||
logSpy.mock.calls.some(([message]) =>
|
||||
String(message).includes(
|
||||
'Skipping plugins/broken-plugin: unable to inspect shared plugin entry'
|
||||
)
|
||||
)
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it('writes global and instance registries with different authoritative install locations', () => {
|
||||
const globalRegistryPath = path.join(claudeDir(), 'plugins', 'known_marketplaces.json');
|
||||
ensureMarketplacePayload(claudeDir());
|
||||
|
||||
Reference in new issue
Block a user