@fto-consult/expo-ui 7.5.40 → 7.5.41
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/index.js +1 -1
- package/electron/index.js +5 -2
- package/package.json +1 -1
package/bin/index.js
CHANGED
package/electron/index.js
CHANGED
@@ -31,9 +31,11 @@ const isAsar = (typeof require.main =="string" && require.main ||"").indexOf('ap
|
|
31
31
|
const distPath = path.join("dist",'index.html');
|
32
32
|
|
33
33
|
const processCWD = process.cwd();
|
34
|
+
const asarPath = path.resolve(processCWD,"resources","app.asar");
|
34
35
|
const electronProjectRoot = mainProjectRoot && typeof mainProjectRoot =='string' && fs.existsSync(path.resolve(mainProjectRoot)) && fs.existsSync(path.resolve(mainProjectRoot,distPath)) && path.resolve(mainProjectRoot) || null;
|
35
36
|
const projectRoot = electronProjectRoot || fs.existsSync(path.resolve(processCWD,"electron")) && fs.existsSync(path.resolve(processCWD,"electron",distPath)) && path.resolve(processCWD,"electron")
|
36
|
-
|| fs.existsSync(path.resolve(processCWD,distPath)) && path.resolve(processCWD) ||
|
37
|
+
|| fs.existsSync(path.resolve(processCWD,distPath)) && path.resolve(processCWD) || fs.existsSync(asarPath) && fs.existsSync(path.relative(asarPath,"dist")) && asarPath ||
|
38
|
+
processCWD;
|
37
39
|
const packageJSONPath = fs.existsSync(processCWD,"package.json")? path.resolve(processCWD,"package.json") : path.resolve(projectRoot,"package.json");
|
38
40
|
const packageJSON = fs.existsSync(packageJSONPath) ? Object.assign({},require(`${packageJSONPath}`)) : {};
|
39
41
|
const appName = typeof packageJSON.realAppName =='string' && packageJSON.realAppName || typeof packageJSON.name =="string" && packageJSON.name || "";
|
@@ -49,10 +51,11 @@ const mainProcessIndex = projectRoot && fs.existsSync(path.resolve(projectRoot,m
|
|
49
51
|
const mainProcessRequired = mainProcessIndex && require(`${mainProcessIndex}`);
|
50
52
|
//pour étendre les fonctionnalités au niveau du main proceess, bien vouloir écrire dans le fichier projectRoot/electron/main/index.js
|
51
53
|
const mainProcess = mainProcessRequired && typeof mainProcessRequired =='object'? mainProcessRequired : {};
|
54
|
+
const execPath = app.getPath ('exe') || process.execPath;
|
52
55
|
|
53
56
|
// Gardez une reference globale de l'objet window, si vous ne le faites pas, la fenetre sera
|
54
57
|
if(!isValidUrl(pUrl) && !fs.existsSync(indexFilePath)){
|
55
|
-
throw {message:`Unable to start the application: index file located at [${indexFilePath}] does not exists : projectRoot = [${projectRoot}],
|
58
|
+
throw {message:`Unable to start the application: index file located at [${indexFilePath}] does not exists : projectRoot = [${projectRoot}], exec path is ${execPath}`}
|
56
59
|
}
|
57
60
|
|
58
61
|
const quit = ()=>{
|