@fto-consult/expo-ui 5.6.6 → 5.6.8
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/babel.config.alias.js +0 -2
- package/copy-env-file.js +3 -3
- package/electron/utils/writeFile.js +10 -2
- package/package.json +1 -1
package/babel.config.alias.js
CHANGED
|
@@ -2,8 +2,6 @@ const path = require("path");
|
|
|
2
2
|
const fs = require("fs");
|
|
3
3
|
const writeFile = require("./electron/utils/writeFile");
|
|
4
4
|
module.exports = (opts)=>{
|
|
5
|
-
console.log(process.env.EXPO_UI_PATH," is process envvvvv");
|
|
6
|
-
console.log(JSON.stringify(process.env)," is stringityffff");
|
|
7
5
|
const dir = path.resolve(__dirname);
|
|
8
6
|
const base = opts.base || process.cwd();
|
|
9
7
|
const assets = path.resolve(dir,"assets");
|
package/copy-env-file.js
CHANGED
|
@@ -6,9 +6,9 @@ const writeFile = require("./electron/utils/writeFile");
|
|
|
6
6
|
*/
|
|
7
7
|
module.exports = (projectRoot,forceCreate)=>{
|
|
8
8
|
projectRoot = projectRoot && typeof projectRoot =="string" && fs.existsSync(projectRoot) && projectRoot || process.cwd();
|
|
9
|
-
const environmentPath = path.resolve(projectRoot,"
|
|
10
|
-
const localEnv = path.resolve(__dirname,"
|
|
11
|
-
console.log(localEnv,environmentPath," is local and
|
|
9
|
+
const environmentPath = path.resolve(projectRoot,".env");
|
|
10
|
+
const localEnv = path.resolve(__dirname,".env");
|
|
11
|
+
console.log(localEnv,environmentPath," is local and environment exists ? ",fs.existsSync(environmentPath))
|
|
12
12
|
if(environmentPath && fs.existsSync(environmentPath)){
|
|
13
13
|
// File ".env" will be created or overwritten by default.
|
|
14
14
|
try {
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
const fs = require("fs");
|
|
2
|
+
const p = require("path");
|
|
2
3
|
module.exports = function writeFile(path, contents, cb) {
|
|
3
|
-
if(
|
|
4
|
-
|
|
4
|
+
if(typeof path =='string' && path){
|
|
5
|
+
const fileName = p.basename(path);
|
|
6
|
+
if(fileName){
|
|
7
|
+
const pp = p.dirname(path);
|
|
8
|
+
if(require("./createDir")(pp)){
|
|
9
|
+
console.log("writting file on ",p.join(pp,fileName));
|
|
10
|
+
return fs.writeFileSync(p.join(pp,fileName), contents, cb);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
5
13
|
}
|
|
6
14
|
throw {message : 'impossible de créer le repertoire associé au fichier'+path};
|
|
7
15
|
}
|