From 1f38bfe168fd855d29eab125b82cdaace0f93e72 Mon Sep 17 00:00:00 2001 From: Takeshi Date: Thu, 15 Feb 2024 19:56:23 -0700 Subject: [PATCH] Use switch statement instead --- src/utils/gitly.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/utils/gitly.ts b/src/utils/gitly.ts index 447910a..bf7d3ff 100644 --- a/src/utils/gitly.ts +++ b/src/utils/gitly.ts @@ -14,9 +14,15 @@ export default async function gitly( destination: string, options: GitlyOptions ): Promise<[string, string]> { - if (options?.backend === 'git') { - return await clone(repository, destination, options) + let source: string = ''; + switch (options?.backend) { + case 'git': + source = await clone(repository, options) + break; + default: + source = await download(repository, options) + break; } - const source = await download(repository, options) + return [source, await extract(source, destination, options)] }