@fto-consult/expo-ui 7.4.27 → 7.4.28
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/electron/index.js +7 -0
- package/electron/preload.js +3 -1
- package/package.json +1 -1
package/electron/index.js
CHANGED
@@ -357,6 +357,13 @@ ipcMain.on("electron-get-path",(event,pathName)=>{
|
|
357
357
|
return p;
|
358
358
|
});
|
359
359
|
|
360
|
+
ipcMain.on("electron-get-project-root",(event)=>{
|
361
|
+
return projectRoot;
|
362
|
+
});
|
363
|
+
ipcMain.on("electron-get-electron-project-root",(event)=>{
|
364
|
+
return electronProjectRoot;
|
365
|
+
});
|
366
|
+
|
360
367
|
ipcMain.on("electron-get-package-json",(event)=>{
|
361
368
|
const packageJSON = path.resolve(projectRoot,"package.json");
|
362
369
|
if(fs.existsSync(packageJSON)){
|
package/electron/preload.js
CHANGED
@@ -7,11 +7,13 @@ const fs = require("fs");
|
|
7
7
|
const isObj = x=>x && typeof x =='object' && !Array.isArray(x);
|
8
8
|
const isNonNullString = x=>x && typeof x =='string';
|
9
9
|
const packageJSONStr = ipcRenderer.sendSync("electron-get-package-json");
|
10
|
+
const projectRoot = ipcRenderer.sendSync("electron-get-electron-project-root");
|
11
|
+
const pathsJS = projectRoot && fs.existsSync(projectRoot) && path.resolve(projectRoot,"paths.json") || null;
|
10
12
|
const _app = packageJSONStr ? JSON.parse(packageJSONStr) : {};
|
11
13
|
if(!_app || typeof _app !=='object' || typeof _app.name !=='string'){
|
12
14
|
throw {message : "Contenu du fichier "+packagePath+" invalide!! Veuillez spécifier un nom valide d'application, propriété <<name>> dudit fichier"}
|
13
15
|
}
|
14
|
-
const paths = require(
|
16
|
+
const paths = pathsJS ? require(`${pathsJS}`) : {};
|
15
17
|
const APP_NAME = _app.name.trim().toUpperCase();
|
16
18
|
let backupPathField = "_e_backupDataPath";
|
17
19
|
let cBackupPathField = "company"+backupPathField;
|