@kvell007/embed-labs-cli 0.1.0-alpha.15 → 0.1.0-alpha.16

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 CHANGED
@@ -2105,6 +2105,7 @@ async function cleanupLegacyOpenCodePluginRemnants(targetRoot, globalInstall) {
2105
2105
  ];
2106
2106
  if (globalInstall) {
2107
2107
  legacyPaths.push(join(targetRoot, "plugins", "embed-labs.js"));
2108
+ legacyPaths.push(...await discoverLegacyOpenCodeBackupPaths(targetRoot, warnings));
2108
2109
  }
2109
2110
  for (const candidate of legacyPaths) {
2110
2111
  try {
@@ -2123,6 +2124,30 @@ async function cleanupLegacyOpenCodePluginRemnants(targetRoot, globalInstall) {
2123
2124
  ...(warnings.length > 0 ? { warnings } : {})
2124
2125
  };
2125
2126
  }
2127
+ async function discoverLegacyOpenCodeBackupPaths(targetRoot, warnings) {
2128
+ const paths = [];
2129
+ try {
2130
+ const entries = await readdir(targetRoot, { withFileTypes: true });
2131
+ for (const entry of entries) {
2132
+ if (!entry.isFile() || !entry.name.includes(".bak"))
2133
+ continue;
2134
+ const filePath = join(targetRoot, entry.name);
2135
+ try {
2136
+ const current = await readFile(filePath, "utf8");
2137
+ if (current.includes("dbt-agent") || current.includes("development-board-toolchain")) {
2138
+ paths.push(filePath);
2139
+ }
2140
+ }
2141
+ catch (error) {
2142
+ warnings.push(`Could not inspect legacy OpenCode backup ${filePath}: ${error instanceof Error ? error.message : String(error)}`);
2143
+ }
2144
+ }
2145
+ }
2146
+ catch {
2147
+ return paths;
2148
+ }
2149
+ return paths;
2150
+ }
2126
2151
  function legacyOpenCodeCleanupWarning(cleanup) {
2127
2152
  const parts = [];
2128
2153
  if (cleanup.legacy_removed_paths.length > 0) {