plugin-updater 1.0.28 → 1.0.30
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.js +16 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -48,6 +48,8 @@ function writeLog(message, isError = false) {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
catch { /* never crash on log failure */ }
|
|
51
|
+
if (process.env.PLUGIN_UPDATER_LIBRARY_MODE === "1")
|
|
52
|
+
return;
|
|
51
53
|
if (isError)
|
|
52
54
|
console.error(message);
|
|
53
55
|
else if (loggingEnabled)
|
|
@@ -440,12 +442,19 @@ export async function earlyLaunch(configDir, plugins) {
|
|
|
440
442
|
return;
|
|
441
443
|
}
|
|
442
444
|
for (const plugin of plugins) {
|
|
443
|
-
|
|
445
|
+
// absence of the enabled key means enabled, matching the loader TUI
|
|
446
|
+
if (plugin.enabled === false) {
|
|
447
|
+
writeLog(`Skipping disabled plugin ${plugin.name}`);
|
|
444
448
|
continue;
|
|
445
|
-
|
|
449
|
+
}
|
|
450
|
+
if (plugin.autoUpdate === false) {
|
|
451
|
+
writeLog(`Skipping auto-update for ${plugin.name} (autoUpdate off)`);
|
|
446
452
|
continue;
|
|
447
|
-
|
|
453
|
+
}
|
|
454
|
+
if (!plugin.url) {
|
|
455
|
+
writeLog(`Skipping ${plugin.name}: no url in plugins.json`, true);
|
|
448
456
|
continue;
|
|
457
|
+
}
|
|
449
458
|
writeLog(`Processing earlyLaunch for ${plugin.name}`);
|
|
450
459
|
try {
|
|
451
460
|
const updateResult = updatePlugin(plugin.name, plugin.url, plugin.branch, null, plugin.updateInterval ?? 1);
|
|
@@ -479,4 +488,7 @@ export async function activate(opencodeHookInput) {
|
|
|
479
488
|
}
|
|
480
489
|
await earlyLaunch(configDir, gitPlugins);
|
|
481
490
|
}
|
|
482
|
-
|
|
491
|
+
// consumers like the loader TUI import this module for its API only — running
|
|
492
|
+
// the full updater sequence on import would print over their screen
|
|
493
|
+
if (process.env.PLUGIN_UPDATER_LIBRARY_MODE !== "1")
|
|
494
|
+
activate();
|