feat(create-mcfly): catch error
This commit is contained in:
parent
bea5cc039d
commit
de89c9df5a
1 changed files with 11 additions and 7 deletions
|
@ -3,12 +3,16 @@
|
||||||
const { downloadTemplate } = require("giget");
|
const { downloadTemplate } = require("giget");
|
||||||
create();
|
create();
|
||||||
async function create() {
|
async function create() {
|
||||||
const { source, dir } = await downloadTemplate(
|
try {
|
||||||
"github:ayoayco/mcfly/templates/basic",
|
const { source, dir } = await downloadTemplate(
|
||||||
{
|
"github:ayoayco/mcfly/templates/basic",
|
||||||
dir: "mcfly-app",
|
{
|
||||||
}
|
dir: "mcfly-app",
|
||||||
);
|
}
|
||||||
console.log(`✨ New McFly app created: ${dir}`);
|
);
|
||||||
|
console.log(`✨ New McFly app created: ${dir}`);
|
||||||
|
} catch (e) {
|
||||||
|
console.error('😱 "mcfly-app" directory already exists');
|
||||||
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue