eitri-cli 1.5.0 → 1.5.1-beta.1
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/package.json
CHANGED
|
@@ -115,7 +115,7 @@ module.exports = class VegvisirService {
|
|
|
115
115
|
);
|
|
116
116
|
const fileContent = await readFile(workspaceGlobalPath, "utf8");
|
|
117
117
|
const workspace = JSON.parse(fileContent);
|
|
118
|
-
console.log("
|
|
118
|
+
console.log("Construindo de", workspace.id)
|
|
119
119
|
workspace.id = validateUUID(this.workspaceId) ? this.workspaceId : workspace.id;
|
|
120
120
|
return workspace;
|
|
121
121
|
} catch (error) {
|
|
@@ -40,9 +40,23 @@ class WoodCoffee {
|
|
|
40
40
|
return { projectPath };
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
async readEitriAppConf(projectPath) {
|
|
44
|
+
let confPath = path.join(projectPath, "miniapp.conf.js");
|
|
45
|
+
if (fs.existsSync(confPath)) {
|
|
46
|
+
return require(confPath);
|
|
47
|
+
}
|
|
48
|
+
confPath = path.join(projectPath, "eitri-app.conf.js");
|
|
49
|
+
if (fs.existsSync(confPath)) {
|
|
50
|
+
return require(confPath)
|
|
51
|
+
}
|
|
52
|
+
confPath = path.join(projectPath, "eitri-app.conf.json");
|
|
53
|
+
if (fs.existsSync(confPath)) {
|
|
54
|
+
return JSON.parse(await fs.promises.readFile(confPath, "utf-8"));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
43
57
|
/**
|
|
44
58
|
*
|
|
45
|
-
* @returns Objeto que representa a estrutura de
|
|
59
|
+
* @returns Objeto que representa a estrutura de diretórios do projeto criado
|
|
46
60
|
*/
|
|
47
61
|
async template(projectName, templateUrl, projectPath, target) {
|
|
48
62
|
await this.downloadFromGithub(templateUrl, projectName, projectPath);
|
|
@@ -53,7 +67,7 @@ class WoodCoffee {
|
|
|
53
67
|
"About.jsx"
|
|
54
68
|
);
|
|
55
69
|
|
|
56
|
-
const miniAppConf =
|
|
70
|
+
const miniAppConf = await this.readEitriAppConf(projectPath)
|
|
57
71
|
|
|
58
72
|
if (fs.existsSync(aboutJsxPath)) {
|
|
59
73
|
try {
|
|
@@ -245,9 +259,9 @@ class WoodCoffee {
|
|
|
245
259
|
confString,
|
|
246
260
|
"utf8"
|
|
247
261
|
);
|
|
248
|
-
const
|
|
249
|
-
if(fs.existsSync(
|
|
250
|
-
await rm(
|
|
262
|
+
const oldConfPath = path.join(project.projectPath, "miniapp.conf.js");
|
|
263
|
+
if(fs.existsSync(oldConfPath)) {
|
|
264
|
+
await rm(oldConfPath, {force: true})
|
|
251
265
|
}
|
|
252
266
|
}
|
|
253
267
|
|