Skip to content

Commit

Permalink
Use switch statement instead
Browse files Browse the repository at this point in the history
  • Loading branch information
Takeshi committed Feb 16, 2024
1 parent dfe1116 commit 1f38bfe
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/utils/gitly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
}

0 comments on commit 1f38bfe

Please sign in to comment.