Skip to content

Commit

Permalink
Don't request baseUrl twice if not provided in args
Browse files Browse the repository at this point in the history
  • Loading branch information
treetrum committed Feb 21, 2025
1 parent d10fe01 commit 0ff04ac
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ const main = async (options: Options) => {
await browser.close();

console.log(
"\nDownloading complete. You can find your books in the 'downloads' folder"
"\nDownloading complete. You can find your books in the 'downloads' folder."
);
};

Expand Down Expand Up @@ -510,15 +510,6 @@ const sanitizeBaseURL = async (baseUrl: string | undefined) => {
.parse();

const baseUrl = await sanitizeBaseURL(args.baseUrl);
args.baseUrl ??
(
await prompts({
type: "text",
name: "baseUrl",
message: "Enter the Amazon base URL",
instructions: "e.g. https://www.amazon.com",
})
).baseUrl;

main({ ...args, baseUrl });
})();

0 comments on commit 0ff04ac

Please sign in to comment.