@axeth/create-cli 2.0.3 → 2.0.5
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
package/src/class/AxethCLI.ts
CHANGED
|
@@ -36,10 +36,19 @@ class AxethCLI {
|
|
|
36
36
|
const spinner = prompt.spinner({ indicator: "dots" });
|
|
37
37
|
|
|
38
38
|
await this.generateTemplate(addonInfo, config, minecraftServerVersion, minecraftServerUIVersion, spinner);
|
|
39
|
-
await prompt.confirm({
|
|
40
|
-
message: "Open on VSCode
|
|
39
|
+
const openVSCode = await prompt.confirm({
|
|
40
|
+
message: "Open on VSCode?",
|
|
41
41
|
initialValue: false
|
|
42
|
-
})
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
if (openVSCode) {
|
|
45
|
+
spawn("code", [path.join(process.cwd(), addonInfo.addonName.replace(/\s+/g, "-").toLowerCase())], {
|
|
46
|
+
stdio: "inherit",
|
|
47
|
+
shell: true
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
prompt.outro(color.green(`\n Successfully created add-on: ${addonInfo.addonName}\n`));
|
|
51
|
+
process.exit(0);
|
|
43
52
|
}
|
|
44
53
|
|
|
45
54
|
private async generateTemplate(addonInfo: { [x: string]: any }, config: { [x: string]: any }, minecraftServerVersion: string, minecraftServerUIVersion: string, spinner: any) {
|
|
@@ -38,7 +38,7 @@ class TemplateGenerators {
|
|
|
38
38
|
spinner.start("Creating template pack files...");
|
|
39
39
|
|
|
40
40
|
for (const filePath of this.fileList.keys()) {
|
|
41
|
-
const fullPath = path.join(process.cwd(), config['
|
|
41
|
+
const fullPath = path.join(process.cwd(), config['project_name'], filePath);
|
|
42
42
|
const shortPath = filePath
|
|
43
43
|
.split('/')
|
|
44
44
|
.slice(-5)
|
|
@@ -49,7 +49,7 @@ class TemplateGenerators {
|
|
|
49
49
|
}
|
|
50
50
|
spinner.stop("Template pack files generated.");
|
|
51
51
|
spinner.start("Installing dependencies...");
|
|
52
|
-
await this.installDependencies(config['
|
|
52
|
+
await this.installDependencies(config['project_name'], this.dependencies);
|
|
53
53
|
spinner.stop("Dependencies installed.");
|
|
54
54
|
}
|
|
55
55
|
|