beauticode-dsh 1.0.1 → 1.0.2
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/beauticode-dsh +17 -1
- package/cli.js +17 -1
- package/package.json +1 -1
package/bin/beauticode-dsh
CHANGED
|
@@ -11,7 +11,23 @@ import os from "node:os";
|
|
|
11
11
|
import path from "node:path";
|
|
12
12
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
function findPackageRoot(startDir) {
|
|
15
|
+
let dir = startDir;
|
|
16
|
+
for (let i = 0; i < 5; i += 1) {
|
|
17
|
+
if (
|
|
18
|
+
fs.existsSync(path.join(dir, "package.json")) &&
|
|
19
|
+
fs.existsSync(path.join(dir, "index.mjs"))
|
|
20
|
+
) {
|
|
21
|
+
return dir;
|
|
22
|
+
}
|
|
23
|
+
const parent = path.dirname(dir);
|
|
24
|
+
if (parent === dir) break;
|
|
25
|
+
dir = parent;
|
|
26
|
+
}
|
|
27
|
+
return startDir;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const here = findPackageRoot(path.dirname(fileURLToPath(import.meta.url)));
|
|
15
31
|
const pluginName = "beauticode-dsh";
|
|
16
32
|
const bridgeId = "beauticode-bridge";
|
|
17
33
|
|
package/cli.js
CHANGED
|
@@ -11,7 +11,23 @@ import os from "node:os";
|
|
|
11
11
|
import path from "node:path";
|
|
12
12
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
function findPackageRoot(startDir) {
|
|
15
|
+
let dir = startDir;
|
|
16
|
+
for (let i = 0; i < 5; i += 1) {
|
|
17
|
+
if (
|
|
18
|
+
fs.existsSync(path.join(dir, "package.json")) &&
|
|
19
|
+
fs.existsSync(path.join(dir, "index.mjs"))
|
|
20
|
+
) {
|
|
21
|
+
return dir;
|
|
22
|
+
}
|
|
23
|
+
const parent = path.dirname(dir);
|
|
24
|
+
if (parent === dir) break;
|
|
25
|
+
dir = parent;
|
|
26
|
+
}
|
|
27
|
+
return startDir;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const here = findPackageRoot(path.dirname(fileURLToPath(import.meta.url)));
|
|
15
31
|
const pluginName = "beauticode-dsh";
|
|
16
32
|
const bridgeId = "beauticode-bridge";
|
|
17
33
|
|