@axeth/create-cli 3.0.2 → 3.0.3
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/CHANGELOG.md +6 -0
- package/dist/index.js +3 -12
- package/package.json +1 -1
- package/src/class/AxethCLI.ts +4 -14
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -102,7 +102,6 @@ var AxethCLI = class {
|
|
|
102
102
|
this.axethCore = `@axeth/core`;
|
|
103
103
|
console.clear();
|
|
104
104
|
this.template = new TemplateGenerators();
|
|
105
|
-
console.log("Initializing Axeth CLI...");
|
|
106
105
|
this.init().catch((err) => {
|
|
107
106
|
console.error("Fatal error:", err);
|
|
108
107
|
process.exit(1);
|
|
@@ -110,17 +109,12 @@ var AxethCLI = class {
|
|
|
110
109
|
}
|
|
111
110
|
async version() {
|
|
112
111
|
try {
|
|
113
|
-
const pkgPath = path2.join(__dirname, "
|
|
112
|
+
const pkgPath = path2.join(__dirname, "../package.json");
|
|
114
113
|
const pkgData = JSON.parse(await fs2.readFile(pkgPath, "utf-8"));
|
|
115
114
|
return pkgData.version;
|
|
116
115
|
} catch (err) {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
const cliPkgData = JSON.parse(await fs2.readFile(cliPkgPath, "utf-8"));
|
|
120
|
-
return cliPkgData.version;
|
|
121
|
-
} catch {
|
|
122
|
-
return "3.0.0";
|
|
123
|
-
}
|
|
116
|
+
console.warn("Failed to read version from package.json");
|
|
117
|
+
return "0.0.0";
|
|
124
118
|
}
|
|
125
119
|
}
|
|
126
120
|
async init() {
|
|
@@ -193,7 +187,6 @@ var AxethCLI = class {
|
|
|
193
187
|
async addonInfoPrompt(version, onCancel) {
|
|
194
188
|
return await new Promise((resolve, reject) => {
|
|
195
189
|
try {
|
|
196
|
-
console.log("Starting addon info prompt...");
|
|
197
190
|
this.registerIntro(
|
|
198
191
|
"\n _ _ \n /_\\ __ _____| |_ \n / _ \\ \\ \\ / -_) _|\n /_/ \\_\\/\\_\\_\\___|\\__|\n ",
|
|
199
192
|
"Axeth CLI",
|
|
@@ -214,11 +207,9 @@ var AxethCLI = class {
|
|
|
214
207
|
this.runPrompts("addonInfo", onCancel).then((responses) => {
|
|
215
208
|
resolve(responses);
|
|
216
209
|
}).catch((err) => {
|
|
217
|
-
console.error("Error in runPrompts:", err);
|
|
218
210
|
reject(err);
|
|
219
211
|
});
|
|
220
212
|
} catch (err) {
|
|
221
|
-
console.error("Error in addonInfoPrompt:", err);
|
|
222
213
|
reject(err);
|
|
223
214
|
}
|
|
224
215
|
});
|
package/package.json
CHANGED
package/src/class/AxethCLI.ts
CHANGED
|
@@ -3,7 +3,7 @@ import color from "colors";
|
|
|
3
3
|
import { TemplateGenerators } from "./TemplateGenerators";
|
|
4
4
|
import fs from "fs-extra";
|
|
5
5
|
import path from "path";
|
|
6
|
-
import { exec
|
|
6
|
+
import { exec } from "child_process";
|
|
7
7
|
|
|
8
8
|
class AxethCLI {
|
|
9
9
|
private promptGroups: Record<string, Record<string, (opts?: any) => any>> =
|
|
@@ -17,7 +17,6 @@ class AxethCLI {
|
|
|
17
17
|
constructor() {
|
|
18
18
|
console.clear();
|
|
19
19
|
this.template = new TemplateGenerators();
|
|
20
|
-
console.log("Initializing Axeth CLI...");
|
|
21
20
|
this.init().catch((err) => {
|
|
22
21
|
console.error("Fatal error:", err);
|
|
23
22
|
process.exit(1);
|
|
@@ -26,18 +25,12 @@ class AxethCLI {
|
|
|
26
25
|
|
|
27
26
|
private async version() {
|
|
28
27
|
try {
|
|
29
|
-
const pkgPath = path.join(__dirname, "
|
|
28
|
+
const pkgPath = path.join(__dirname, "../package.json");
|
|
30
29
|
const pkgData = JSON.parse(await fs.readFile(pkgPath, "utf-8"));
|
|
31
30
|
return pkgData.version;
|
|
32
31
|
} catch (err) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const cliPkgPath = path.join(__dirname, "../../package.json");
|
|
36
|
-
const cliPkgData = JSON.parse(await fs.readFile(cliPkgPath, "utf-8"));
|
|
37
|
-
return cliPkgData.version;
|
|
38
|
-
} catch {
|
|
39
|
-
return "3.0.0";
|
|
40
|
-
}
|
|
32
|
+
console.warn("Failed to read version from package.json");
|
|
33
|
+
return "0.0.0";
|
|
41
34
|
}
|
|
42
35
|
}
|
|
43
36
|
|
|
@@ -128,7 +121,6 @@ class AxethCLI {
|
|
|
128
121
|
private async addonInfoPrompt(version: string, onCancel?: () => void) {
|
|
129
122
|
return await new Promise<{ [x: string]: any }>((resolve, reject) => {
|
|
130
123
|
try {
|
|
131
|
-
console.log("Starting addon info prompt...");
|
|
132
124
|
this.registerIntro(
|
|
133
125
|
"\n _ _ \n /_\\ __ _____| |_ \n / _ \\ \\ \\ / -_) _|\n /_/ \\_\\/\\_\\_\\___|\\__|\n ",
|
|
134
126
|
"Axeth CLI",
|
|
@@ -149,11 +141,9 @@ class AxethCLI {
|
|
|
149
141
|
this.runPrompts("addonInfo", onCancel).then((responses) => {
|
|
150
142
|
resolve(responses);
|
|
151
143
|
}).catch((err) => {
|
|
152
|
-
console.error("Error in runPrompts:", err);
|
|
153
144
|
reject(err);
|
|
154
145
|
});
|
|
155
146
|
} catch (err) {
|
|
156
|
-
console.error("Error in addonInfoPrompt:", err);
|
|
157
147
|
reject(err);
|
|
158
148
|
}
|
|
159
149
|
});
|