@gzl10/nexus-backend 0.19.0 → 0.19.1

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/cli.js CHANGED
@@ -865,13 +865,17 @@ import { readFileSync as readFileSync4 } from "fs";
865
865
  import { dirname as dirname5, join as join6 } from "path";
866
866
  import { fileURLToPath as fileURLToPath2 } from "url";
867
867
  function getVersion() {
868
- const __dir = dirname5(fileURLToPath2(import.meta.url));
869
- try {
870
- const pkg3 = JSON.parse(readFileSync4(join6(__dir, "..", "..", "package.json"), "utf-8"));
871
- return pkg3.version;
872
- } catch {
873
- return "unknown";
868
+ let dir = dirname5(fileURLToPath2(import.meta.url));
869
+ for (let i = 0; i < 5; i++) {
870
+ const candidate = join6(dir, "package.json");
871
+ try {
872
+ const pkg3 = JSON.parse(readFileSync4(candidate, "utf-8"));
873
+ if (pkg3.name === "@gzl10/nexus-backend") return pkg3.version;
874
+ } catch {
875
+ }
876
+ dir = dirname5(dir);
874
877
  }
878
+ return "unknown";
875
879
  }
876
880
  async function collectInfo() {
877
881
  const config3 = resolveConfig();