@driftdev/cli 1.12.0 → 1.12.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.
Files changed (2) hide show
  1. package/dist/drift.js +10 -5
  2. package/package.json +1 -1
package/dist/drift.js CHANGED
@@ -80,12 +80,17 @@ var cached;
80
80
  function getVersion() {
81
81
  if (cached)
82
82
  return cached;
83
- try {
84
- cached = JSON.parse(readFileSync(join2(__dirname2, "../../package.json"), "utf-8")).version ?? "0.0.0";
85
- } catch {
86
- cached = "0.0.0";
83
+ for (const rel of ["../package.json", "../../package.json"]) {
84
+ try {
85
+ const pkg = JSON.parse(readFileSync(join2(__dirname2, rel), "utf-8"));
86
+ if (pkg.name === "@driftdev/cli" && typeof pkg.version === "string") {
87
+ cached = pkg.version;
88
+ return pkg.version;
89
+ }
90
+ } catch {}
87
91
  }
88
- return cached ?? "0.0.0";
92
+ cached = "0.0.0";
93
+ return cached;
89
94
  }
90
95
 
91
96
  // src/cache/spec-cache.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@driftdev/cli",
3
- "version": "1.12.0",
3
+ "version": "1.12.1",
4
4
  "description": "Drift CLI - detect when your docs drift from your code",
5
5
  "keywords": [
6
6
  "typescript",