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");
|
||||
create();
|
||||
async function create() {
|
||||
const { source, dir } = await downloadTemplate(
|
||||
"github:ayoayco/mcfly/templates/basic",
|
||||
{
|
||||
dir: "mcfly-app",
|
||||
}
|
||||
);
|
||||
console.log(`✨ New McFly app created: ${dir}`);
|
||||
try {
|
||||
const { source, dir } = await downloadTemplate(
|
||||
"github:ayoayco/mcfly/templates/basic",
|
||||
{
|
||||
dir: "mcfly-app",
|
||||
}
|
||||
);
|
||||
console.log(`✨ New McFly app created: ${dir}`);
|
||||
} catch (e) {
|
||||
console.error('😱 "mcfly-app" directory already exists');
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue