From fc0c76e35b7616bd231c8870150448bd18ebaf22 Mon Sep 17 00:00:00 2001 From: Adelin Niculae <43118261+adelinn@users.noreply.github.com> Date: Wed, 6 Dec 2023 18:58:27 +0200 Subject: [PATCH] add error catching for schema-sync folder check --- src/copyConfig.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/copyConfig.ts b/src/copyConfig.ts index 8cd82f7..4ade08c 100644 --- a/src/copyConfig.ts +++ b/src/copyConfig.ts @@ -7,11 +7,13 @@ export async function copyConfig(force: boolean) { const srcDir = path.resolve(__dirname, 'install'); const targetDir = process.cwd(); - // Test if it doesn't already exist then if it does show a warning with 3s before continuing + // Test if it doesn't already exist then if it does exit if (!force) { await fs.access(path.resolve(targetDir, 'schema-sync')).then(() => { console.log('Config folder already exists, use --force to override'); process.exit(0); + }).catch(() => { + console.log('Config folder not found. Installing...'); }); }