@geode/opengeodeweb-front 10.27.0-rc.5 → 10.27.0-rc.6
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.
|
@@ -39,8 +39,7 @@ function killHttpMicroservice(microservice) {
|
|
|
39
39
|
const failMessage = `Failed to kill ${microservice.name}`;
|
|
40
40
|
async function do_kill() {
|
|
41
41
|
try {
|
|
42
|
-
|
|
43
|
-
await fetchFunc(microservice.url, {
|
|
42
|
+
await fetch(microservice.url, {
|
|
44
43
|
method: microservice.method,
|
|
45
44
|
});
|
|
46
45
|
} catch (error) {
|
|
@@ -7,18 +7,13 @@ import path from "node:path";
|
|
|
7
7
|
import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json" with { type: "json" };
|
|
8
8
|
|
|
9
9
|
// Local imports
|
|
10
|
-
import {
|
|
10
|
+
import { getAvailablePort, waitForReady } from "./scripts.js";
|
|
11
11
|
import { microservicesMetadatasPath, projectMicroservices } from "./cleanup.js";
|
|
12
12
|
import { executablePath } from "./path.js";
|
|
13
13
|
|
|
14
14
|
const MILLISECONDS_PER_SECOND = 1000;
|
|
15
15
|
const DEFAULT_TIMEOUT_SECONDS = 30;
|
|
16
16
|
|
|
17
|
-
function resolveCommand(execPath, execName) {
|
|
18
|
-
const command = commandExistsSync(execName) ? execName : executablePath(execPath, execName);
|
|
19
|
-
return command;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
17
|
async function runScript(
|
|
23
18
|
execPath,
|
|
24
19
|
execName,
|
|
@@ -26,7 +21,7 @@ async function runScript(
|
|
|
26
21
|
expectedResponse,
|
|
27
22
|
timeoutSeconds = DEFAULT_TIMEOUT_SECONDS,
|
|
28
23
|
) {
|
|
29
|
-
const command =
|
|
24
|
+
const command = executablePath(execPath, execName);
|
|
30
25
|
console.log("runScript", command, args);
|
|
31
26
|
|
|
32
27
|
const child = child_process.spawn(command, args, {
|
|
@@ -69,7 +64,7 @@ async function runBack(execName, execPath, args = {}) {
|
|
|
69
64
|
const backArgs = [
|
|
70
65
|
"--port",
|
|
71
66
|
String(port),
|
|
72
|
-
"--
|
|
67
|
+
"--project_folder_path",
|
|
73
68
|
projectFolderPath,
|
|
74
69
|
"--upload_folder_path",
|
|
75
70
|
uploadFolderPath,
|
|
@@ -95,7 +90,7 @@ async function runViewer(execName, execPath, args = {}) {
|
|
|
95
90
|
const viewerArgs = [
|
|
96
91
|
"--port",
|
|
97
92
|
String(port),
|
|
98
|
-
"--
|
|
93
|
+
"--project_folder_path",
|
|
99
94
|
projectFolderPath,
|
|
100
95
|
"--timeout",
|
|
101
96
|
"0",
|
package/app/utils/local/path.js
CHANGED
|
@@ -9,25 +9,31 @@ import { v4 as uuidv4 } from "uuid";
|
|
|
9
9
|
|
|
10
10
|
// Local imports
|
|
11
11
|
import { appMode } from "./app_mode.js";
|
|
12
|
+
import { commandExistsSync } from "./scripts.js";
|
|
12
13
|
|
|
13
14
|
function executablePath(execPath, execName) {
|
|
15
|
+
const osExecutableName = executableName(execName);
|
|
14
16
|
const resourcesPath = process.env.RESOURCES_PATH;
|
|
15
17
|
const mode = process.env.MODE;
|
|
16
18
|
const nodeEnv = process.env.NODE_ENV;
|
|
17
19
|
console.log("[executablePath]", { execPath, execName, mode, nodeEnv, resourcesPath });
|
|
18
20
|
if (mode === appMode.DESKTOP && nodeEnv === "production") {
|
|
19
|
-
const execPathInResources = path.join(resourcesPath,
|
|
21
|
+
const execPathInResources = path.join(resourcesPath, osExecutableName);
|
|
20
22
|
if (fs.existsSync(execPathInResources)) {
|
|
21
23
|
console.log(`[executablePath] Found executable in resources path: ${execPathInResources}`);
|
|
22
24
|
return execPathInResources;
|
|
23
25
|
}
|
|
24
26
|
}
|
|
25
|
-
const localExecPath = path.join(execPath,
|
|
27
|
+
const localExecPath = path.join(execPath, osExecutableName);
|
|
26
28
|
if (fs.existsSync(localExecPath)) {
|
|
27
29
|
console.log(`[executablePath] Found executable in local path: ${localExecPath}`);
|
|
28
30
|
return localExecPath;
|
|
29
31
|
}
|
|
30
|
-
|
|
32
|
+
if (commandExistsSync(osExecutableName)) {
|
|
33
|
+
console.log(`[executablePath] Found executable in PATH: ${osExecutableName}`);
|
|
34
|
+
return osExecutableName;
|
|
35
|
+
}
|
|
36
|
+
throw new Error(`Executable not found: ${osExecutableName}`);
|
|
31
37
|
}
|
|
32
38
|
|
|
33
39
|
function executableName(execName) {
|
package/package.json
CHANGED