@geode/opengeodeweb-front 10.28.0-rc.6 → 10.28.0-rc.7

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.
@@ -11,28 +11,51 @@ import { v4 as uuidv4 } from "uuid";
11
11
  import { appMode } from "./app_mode.js";
12
12
  import { commandExistsSync } from "./scripts.js";
13
13
 
14
+ function findExecutableInDir(baseDir, execName, osExecutableName) {
15
+ const oneFilePath = path.join(baseDir, osExecutableName);
16
+ if (fs.existsSync(oneFilePath) && fs.statSync(oneFilePath).isFile()) {
17
+ console.log(`[executablePath] Found OneFile executable: ${oneFilePath}`);
18
+ return oneFilePath;
19
+ }
20
+
21
+ const oneDirPath = path.join(baseDir, execName, osExecutableName);
22
+ if (fs.existsSync(oneDirPath) && fs.statSync(oneDirPath).isFile()) {
23
+ console.log(`[executablePath] Found OneDir executable: ${oneDirPath}`);
24
+ return oneDirPath;
25
+ }
26
+ console.log(
27
+ `[executablePath] Executable not found in ${baseDir} (tried OneFile and OneDir): ${execName}`,
28
+ );
29
+ return undefined;
30
+ }
14
31
  function executablePath(execPath, execName) {
15
32
  const osExecutableName = executableName(execName);
16
33
  const resourcesPath = process.env.RESOURCES_PATH;
17
34
  const mode = process.env.MODE;
18
35
  const nodeEnv = process.env.NODE_ENV;
36
+
19
37
  console.log("[executablePath]", { execPath, execName, mode, nodeEnv, resourcesPath });
38
+
39
+ const foundAtExecPath = findExecutableInDir(execPath, execName, osExecutableName);
40
+ if (foundAtExecPath) {
41
+ return foundAtExecPath;
42
+ }
43
+
20
44
  if (mode === appMode.DESKTOP && nodeEnv === "production") {
21
- const execPathInResources = path.join(resourcesPath, osExecutableName);
22
- if (fs.existsSync(execPathInResources)) {
23
- console.log(`[executablePath] Found executable in resources path: ${execPathInResources}`);
24
- return execPathInResources;
45
+ const foundInResources = findExecutableInDir(resourcesPath, execName, osExecutableName);
46
+ if (foundInResources) {
47
+ return foundInResources;
25
48
  }
49
+ throw new Error(
50
+ `Executable not found in execPath (${execPath}) or resourcesPath (${resourcesPath}): ${osExecutableName}`,
51
+ );
26
52
  }
27
- const localExecPath = path.join(execPath, osExecutableName);
28
- if (fs.existsSync(localExecPath)) {
29
- console.log(`[executablePath] Found executable in local path: ${localExecPath}`);
30
- return localExecPath;
31
- }
53
+
32
54
  if (commandExistsSync(osExecutableName)) {
33
55
  console.log(`[executablePath] Found executable in PATH: ${osExecutableName}`);
34
56
  return osExecutableName;
35
57
  }
58
+
36
59
  throw new Error(`Executable not found: ${osExecutableName}`);
37
60
  }
38
61
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geode/opengeodeweb-front",
3
- "version": "10.28.0-rc.6",
3
+ "version": "10.28.0-rc.7",
4
4
  "description": "OpenSource Vue/Nuxt/Pinia/Vuetify framework for web applications",
5
5
  "homepage": "https://github.com/Geode-solutions/OpenGeodeWeb-Front",
6
6
  "bugs": {