plugin-updater 1.0.22 → 1.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.js +19 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -18,4 +18,5 @@ export declare function uninstallNpmPlugin(name: string, configDir: string): str
|
|
|
18
18
|
export declare function updateNpmPlugin(name: string, configDir: string, updateInterval?: number): string;
|
|
19
19
|
export declare function updatePluginPublic(pluginName: string, gitUrl: string, branch?: string, commitHash?: string): Promise<void>;
|
|
20
20
|
export declare function earlyLaunch(configDir: string, plugins: Plugin[]): Promise<void>;
|
|
21
|
+
export declare function activate(): Promise<void>;
|
|
21
22
|
export {};
|
package/dist/index.js
CHANGED
|
@@ -387,4 +387,22 @@ export async function earlyLaunch(configDir, plugins) {
|
|
|
387
387
|
}
|
|
388
388
|
}
|
|
389
389
|
}
|
|
390
|
-
|
|
390
|
+
export async function activate() {
|
|
391
|
+
const isClaude = process.argv.join(" ").includes("claude");
|
|
392
|
+
const appName = isClaude ? "claude" : "opencode";
|
|
393
|
+
const configDir = getAppConfigDir(appName);
|
|
394
|
+
writeLog(`Plugin updater activating for ${appName}`);
|
|
395
|
+
const pluginsJsonPath = path.join(configDir, "config", "plugins.json");
|
|
396
|
+
let gitPlugins = [];
|
|
397
|
+
if (fs.existsSync(pluginsJsonPath)) {
|
|
398
|
+
try {
|
|
399
|
+
gitPlugins = JSON.parse(fs.readFileSync(pluginsJsonPath, "utf-8"));
|
|
400
|
+
writeLog(`Found ${gitPlugins.length} git plugins in plugins.json`);
|
|
401
|
+
}
|
|
402
|
+
catch (e) {
|
|
403
|
+
writeLog(`Failed to parse plugins.json: ${e.message}`, true);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
await earlyLaunch(configDir, gitPlugins);
|
|
407
|
+
}
|
|
408
|
+
activate();
|