@ooneex/cli 1.35.2 → 1.35.3

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
@@ -14661,6 +14661,8 @@ import { existsSync } from "fs";
14661
14661
  import { join as join9 } from "path";
14662
14662
  import { decorator as decorator8 } from "@ooneex/command";
14663
14663
  import { TerminalLogger as TerminalLogger8 } from "@ooneex/logger";
14664
+ var commandNamePattern = /getName\(\)\s*(?::\s*string)?\s*{\s*return\s*["']([^"']+)["'];?\s*}/;
14665
+
14664
14666
  class CommandRunCommand {
14665
14667
  getName() {
14666
14668
  return "command:run";
@@ -14696,6 +14698,21 @@ class CommandRunCommand {
14696
14698
  const moduleDir = join9(modulesDir, entry);
14697
14699
  const commandRunFile = Bun.file(join9(moduleDir, "bin", "command", "run.ts"));
14698
14700
  if (await commandRunFile.exists()) {
14701
+ const commandFiles = new Bun.Glob("src/commands/**/*Command.ts");
14702
+ let hasCommandFiles = false;
14703
+ let hasCommand = false;
14704
+ for await (const commandFilePath of commandFiles.scan({ cwd: moduleDir, onlyFiles: true })) {
14705
+ hasCommandFiles = true;
14706
+ const commandFile = Bun.file(join9(moduleDir, commandFilePath));
14707
+ const commandNameMatch = (await commandFile.text()).match(commandNamePattern);
14708
+ if (commandNameMatch?.[1] === commandName) {
14709
+ hasCommand = true;
14710
+ break;
14711
+ }
14712
+ }
14713
+ if (hasCommandFiles && !hasCommand) {
14714
+ continue;
14715
+ }
14699
14716
  const packageJson = await Bun.file(join9(modulesDir, match)).json();
14700
14717
  modules.push({ name: packageJson.name ?? entry, dir: moduleDir });
14701
14718
  }
@@ -109761,4 +109778,4 @@ SeedRunCommand = __legacyDecorateClassTS([
109761
109778
  // src/index.ts
109762
109779
  await run();
109763
109780
 
109764
- //# debugId=361C007C2B31AB6A64756E2164756E21
109781
+ //# debugId=07A205B5877EEC9664756E2164756E21