mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 03:01:56 +00:00
fix(coding-agent): only update extension in scope it's in
update(source) unconditionally called updateSourceForScope for both user and project scopes, creating a local install even when the source was only registered globally. Unify into a single code path that iterates settings per scope, filtering by identity when a source is provided.
This commit is contained in:
parent
7f78c383c9
commit
bc3fda518d
2 changed files with 5 additions and 6 deletions
|
|
@ -742,20 +742,18 @@ export class DefaultPackageManager implements PackageManager {
|
|||
}
|
||||
|
||||
async update(source?: string): Promise<void> {
|
||||
if (source) {
|
||||
await this.updateSourceForScope(source, "user");
|
||||
await this.updateSourceForScope(source, "project");
|
||||
return;
|
||||
}
|
||||
|
||||
const globalSettings = this.settingsManager.getGlobalSettings();
|
||||
const projectSettings = this.settingsManager.getProjectSettings();
|
||||
const identity = source ? this.getPackageIdentity(source) : undefined;
|
||||
|
||||
for (const pkg of globalSettings.packages ?? []) {
|
||||
const sourceStr = typeof pkg === "string" ? pkg : pkg.source;
|
||||
if (identity && this.getPackageIdentity(sourceStr) !== identity) continue;
|
||||
await this.updateSourceForScope(sourceStr, "user");
|
||||
}
|
||||
for (const pkg of projectSettings.packages ?? []) {
|
||||
const sourceStr = typeof pkg === "string" ? pkg : pkg.source;
|
||||
if (identity && this.getPackageIdentity(sourceStr) !== identity) continue;
|
||||
await this.updateSourceForScope(sourceStr, "project");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue