From 0bb6b5dfcd2ae27e9a8c301bd339ca86ecae27d3 Mon Sep 17 00:00:00 2001 From: ayush-coder-hai Date: Sat, 30 Sep 2023 19:09:17 +0530 Subject: [PATCH] made the required changes. --- src/commands/new/file.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/commands/new/file.ts b/src/commands/new/file.ts index fbe83632133..37b8edf263f 100644 --- a/src/commands/new/file.ts +++ b/src/commands/new/file.ts @@ -162,11 +162,10 @@ export default class NewFile extends Command { } } catch (e:any) { if (e.code === 'EACCES') { - console.error('Permission denied to read the file. You do not have the necessary permissions.'); - } else { - await writeFile(fileNameToWriteToDisk, asyncApiFile, { encoding: 'utf8' }); - console.log(`Created file ${fileNameToWriteToDisk}...`); + this.error('Permission denied to read the file. You do not have the necessary permissions.'); } } + await writeFile(fileNameToWriteToDisk, asyncApiFile, { encoding: 'utf8' }); + console.log(`Created file ${fileNameToWriteToDisk}...`); } }