@xutest1/sdk 0.1.2 → 0.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/package.json +1 -1
- package/server.js +6 -2
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { spawn } from "node:child_process";
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
3
|
-
import { join } from "node:path";
|
|
3
|
+
import { join, dirname } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
4
5
|
import { platform, arch } from "node:os";
|
|
6
|
+
// ES module equivalent of __dirname
|
|
7
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
+
const __dirname = dirname(__filename);
|
|
5
9
|
/**
|
|
6
10
|
* Find the ae3code binary - checks node_modules first, then falls back to PATH
|
|
7
11
|
*/
|
|
@@ -27,7 +31,7 @@ function findBinary() {
|
|
|
27
31
|
// Relative to cwd
|
|
28
32
|
join(process.cwd(), "node_modules", "@xutest1", `${pkgPlatform}-${pkgArch}`, "bin", binaryName),
|
|
29
33
|
// Relative to this file (for when SDK is in node_modules)
|
|
30
|
-
join(__dirname, "..",
|
|
34
|
+
join(__dirname, "..", `@xutest1`, `${pkgPlatform}-${pkgArch}`, "bin", binaryName),
|
|
31
35
|
];
|
|
32
36
|
for (const binPath of possiblePaths) {
|
|
33
37
|
if (existsSync(binPath)) {
|