fix(create-mcfly): install deps not awaited
This commit is contained in:
parent
4613b1bcb8
commit
5a6ed3c0e4
3 changed files with 8 additions and 6 deletions
2
package-lock.json
generated
2
package-lock.json
generated
|
@ -3975,7 +3975,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"packages/create-mcfly": {
|
"packages/create-mcfly": {
|
||||||
"version": "0.2.0",
|
"version": "0.2.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"consola": "^3.2.3",
|
"consola": "^3.2.3",
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
const { downloadTemplate } = require("giget");
|
const { downloadTemplate } = require("giget");
|
||||||
const { consola } = require("consola");
|
const { consola } = require("consola");
|
||||||
const { exec } = require("node:child_process");
|
const { execSync: exec } = require("node:child_process");
|
||||||
create();
|
create();
|
||||||
async function create() {
|
async function create() {
|
||||||
console.clear();
|
console.clear();
|
||||||
|
@ -12,7 +12,7 @@ async function create() {
|
||||||
placeholder: "./mcfly-app",
|
placeholder: "./mcfly-app",
|
||||||
})) ?? "mcfly-app";
|
})) ?? "mcfly-app";
|
||||||
try {
|
try {
|
||||||
await consola.start(`Copying template to ${directory}...`);
|
consola.start(`Copying template to ${directory}...`);
|
||||||
await downloadTemplate("github:ayoayco/mcfly/templates/basic", {
|
await downloadTemplate("github:ayoayco/mcfly/templates/basic", {
|
||||||
dir: directory,
|
dir: directory,
|
||||||
});
|
});
|
||||||
|
@ -29,9 +29,10 @@ async function create() {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
if (installDeps) {
|
if (installDeps) {
|
||||||
await consola.start("Installing dependencies...");
|
consola.start("Installing dependencies...");
|
||||||
try {
|
try {
|
||||||
await exec(`npm --prefix ${directory} install`);
|
await exec(`npm --prefix ${directory} install`);
|
||||||
|
consola.success("Done!");
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
consola.error(e);
|
consola.error(e);
|
||||||
}
|
}
|
||||||
|
@ -44,9 +45,10 @@ async function create() {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
if (initializeGit) {
|
if (initializeGit) {
|
||||||
await consola.start("Initializing git repository...");
|
consola.start("Initializing git repository...");
|
||||||
try {
|
try {
|
||||||
await exec(`git -C ${directory} init`);
|
await exec(`git -C ${directory} init`);
|
||||||
|
consola.success("Done!");
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
consola.error(e);
|
consola.error(e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "create-mcfly",
|
"name": "create-mcfly",
|
||||||
"version": "0.2.0",
|
"version": "0.2.1",
|
||||||
"bin": {
|
"bin": {
|
||||||
"create-mcfly": "./index.js"
|
"create-mcfly": "./index.js"
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue