feat(create-mcfly): catch error

This commit is contained in:
Ayo 2023-10-21 21:13:35 +02:00
parent bea5cc039d
commit de89c9df5a

View file

@ -3,6 +3,7 @@
const { downloadTemplate } = require("giget");
create();
async function create() {
try {
const { source, dir } = await downloadTemplate(
"github:ayoayco/mcfly/templates/basic",
{
@ -10,5 +11,8 @@ async function create() {
}
);
console.log(`✨ New McFly app created: ${dir}`);
} catch (e) {
console.error('😱 "mcfly-app" directory already exists');
}
return 1;
}