kooni-bot 0.3.0 → 0.3.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/bin/kooni.js +13 -2
- package/package.json +1 -1
package/bin/kooni.js
CHANGED
|
@@ -16,13 +16,24 @@ import { emitKeypressEvents } from "node:readline";
|
|
|
16
16
|
import { stdin as input, stdout as output } from "node:process";
|
|
17
17
|
import { mkdirSync, writeFileSync, readFileSync, existsSync, rmSync, readdirSync, statSync, cpSync } from "node:fs";
|
|
18
18
|
import { realpathSync } from "node:fs";
|
|
19
|
-
import { join, basename } from "node:path";
|
|
19
|
+
import { join, basename, dirname } from "node:path";
|
|
20
20
|
import { homedir } from "node:os";
|
|
21
21
|
import { execFileSync, spawnSync } from "node:child_process";
|
|
22
22
|
import { randomUUID, createPublicKey, verify as edVerify } from "node:crypto";
|
|
23
23
|
import { fileURLToPath } from "node:url";
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
// Leída del package.json publicado junto a este archivo — nunca hardcodeada,
|
|
26
|
+
// para que --version y la telemetría (cliVersion) no se desincronicen del
|
|
27
|
+
// número real publicado en npm (bug encontrado: quedó fija en "0.2.17" tras
|
|
28
|
+
// el bump a 0.3.0).
|
|
29
|
+
const CLI_VERSION = (() => {
|
|
30
|
+
try {
|
|
31
|
+
const pkgPath = join(dirname(fileURLToPath(import.meta.url)), "..", "package.json");
|
|
32
|
+
return JSON.parse(readFileSync(pkgPath, "utf8")).version || "0.0.0";
|
|
33
|
+
} catch {
|
|
34
|
+
return "0.0.0";
|
|
35
|
+
}
|
|
36
|
+
})();
|
|
26
37
|
|
|
27
38
|
const REPO = process.env.KOONI_REPO || "iamnocodeveloper/kooni-bot";
|
|
28
39
|
const BRANCH = process.env.KOONI_BRANCH || "main";
|
package/package.json
CHANGED