Skip to content

Commit

Permalink
fix: cli download files
Browse files Browse the repository at this point in the history
  • Loading branch information
ido-pluto committed Mar 10, 2024
1 parent 313e49c commit 8b3d0c8
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions src/cli/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ pullCommand
process.exit(0);
}

const useDownloadSequence = files.length > 1;
const fileDownloads = await Promise.all(
files.map(async (file) => {
const isDirectory = saveLocation && await downloadToDirectory(saveLocation);
Expand All @@ -32,23 +31,17 @@ pullCommand
directory,
fileName,
truncateName,
cliProgress: !useDownloadSequence,
cliStyle: "fancy",
parallelStreams: Number(number) || 4
});
})
);

if (fileDownloads.length === 1)
await fileDownloads[0].download();
else {
const downloader = await downloadSequence({
truncateName,
cliProgress: true,
cliStyle: "fancy"
}, ...fileDownloads);
await downloader.download();
}
const downloader = await downloadSequence({
truncateName,
cliProgress: true,
cliStyle: "fancy"
}, ...fileDownloads);
await downloader.download();
})
.version(packageJson.version);

Expand Down

0 comments on commit 8b3d0c8

Please sign in to comment.