@curdx/flow 1.1.1 → 1.1.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/cli/utils.js +13 -4
- package/package.json +1 -1
package/cli/utils.js
CHANGED
|
@@ -5,8 +5,17 @@
|
|
|
5
5
|
|
|
6
6
|
import { spawn, spawnSync } from "node:child_process";
|
|
7
7
|
import { createInterface } from "node:readline";
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
import { readFileSync } from "node:fs";
|
|
9
|
+
import { fileURLToPath } from "node:url";
|
|
10
|
+
import { dirname, join } from "node:path";
|
|
11
|
+
|
|
12
|
+
// Read version dynamically from package.json so `curdx-flow --version` always
|
|
13
|
+
// reflects the installed package version (avoids drift after npm version bumps).
|
|
14
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
15
|
+
const pkgJson = JSON.parse(
|
|
16
|
+
readFileSync(join(__dirname, "..", "package.json"), "utf-8")
|
|
17
|
+
);
|
|
18
|
+
export const VERSION = pkgJson.version;
|
|
10
19
|
|
|
11
20
|
// ---------- Color helpers (no chalk dep) ----------
|
|
12
21
|
const isTTY = process.stdout.isTTY && process.env.TERM !== "dumb";
|
|
@@ -238,8 +247,8 @@ export function pluginCacheDir(pluginName = "curdx-flow", marketplace = "curdx-f
|
|
|
238
247
|
// detection + self-healing: create a symlink to the user-level bun install
|
|
239
248
|
// in a PATH-visible directory.
|
|
240
249
|
|
|
241
|
-
import {
|
|
242
|
-
|
|
250
|
+
import { mkdirSync, symlinkSync, lstatSync, unlinkSync, readlinkSync } from "node:fs";
|
|
251
|
+
// `existsSync` and `join` already imported at the top of this file.
|
|
243
252
|
|
|
244
253
|
const HOME = process.env.HOME || "";
|
|
245
254
|
|