From 86adbc26f980f42173621e260d6b94fd1eb4abc7 Mon Sep 17 00:00:00 2001 From: Martin Donadieu Date: Wed, 4 Sep 2024 02:06:12 +0100 Subject: [PATCH] fix: lint --- src/bin/index.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/bin/index.ts b/src/bin/index.ts index 3a52512..a31e47a 100644 --- a/src/bin/index.ts +++ b/src/bin/index.ts @@ -24,12 +24,12 @@ async function findByExtension(dir: string, ext: string): Promise { return matchedFiles } -async function findPathPlugin(): Promise<{ iosPath: string; androidPath: string }> { +async function findPathPlugin(): Promise<{ iosPath: string, androidPath: string }> { // iOS path let iosPath = '' const oldIosDir = './ios/Plugin' const newIosDir = './ios/Sources' - + if (existsSync(oldIosDir)) { const files = await findByExtension(oldIosDir, 'm') if (!files || !files[0]) { @@ -37,7 +37,8 @@ async function findPathPlugin(): Promise<{ iosPath: string; androidPath: string } const fileName = files[0] iosPath = join(oldIosDir, `${fileName}.swift`) - } else if (existsSync(newIosDir)) { + } + else if (existsSync(newIosDir)) { const pluginDirs = await readdir(newIosDir) const pluginDir = pluginDirs.find(dir => dir.toLowerCase().includes('plugin')) if (!pluginDir) { @@ -50,7 +51,8 @@ async function findPathPlugin(): Promise<{ iosPath: string; androidPath: string } const pluginFile = swiftFiles.find(file => file.toLowerCase().endsWith('plugin')) || swiftFiles[0] iosPath = join(fullPluginDir, `${pluginFile}.swift`) - } else { + } + else { throw new Error('iOS plugin directory not found') }