@earntori/cli 0.2.11 → 0.2.12
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 +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { readdirSync } from "node:fs";
|
|
2
|
+
import { readdirSync, realpathSync } from "node:fs";
|
|
3
3
|
// @earntori/cli — tori login | status | key --limit N [--write env] | stats | logout
|
|
4
4
|
import { readFileSync, writeFileSync, mkdirSync, existsSync, appendFileSync, unlinkSync } from "node:fs";
|
|
5
5
|
import { homedir } from "node:os";
|
|
@@ -166,7 +166,7 @@ function writeJson(p, o) { mkdirSync(dirname(resolve(p)), { recursive: true });
|
|
|
166
166
|
const TORI_MCP_VERSION = "0.1.7";
|
|
167
167
|
function cliVersion(cliBin) {
|
|
168
168
|
try {
|
|
169
|
-
return JSON.parse(readFileSync(resolve(dirname(cliBin), "..", "package.json"), "utf8")).version ?? "latest";
|
|
169
|
+
return JSON.parse(readFileSync(resolve(dirname(realpathSync(cliBin)), "..", "package.json"), "utf8")).version ?? "latest";
|
|
170
170
|
}
|
|
171
171
|
catch {
|
|
172
172
|
return "latest";
|