From 07ac720d73d6b2f119b95d600b4bfee69d53431c Mon Sep 17 00:00:00 2001 From: kitt Date: Sun, 3 Dec 2023 17:53:13 -0500 Subject: [PATCH] prompt for api key --- src/app.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/app.ts b/src/app.ts index cc8f84a..b3f2a2d 100644 --- a/src/app.ts +++ b/src/app.ts @@ -244,6 +244,19 @@ export class App { } if (exporters.includes("splashcat")) { + if (!state.splashcatApiKey) { + const key = (await this.env.prompts.prompt( + "Splashcat API key is not set. Please enter below.", + )).trim(); + if (!key) { + this.env.logger.error("API key is required."); + Deno.exit(1); + } + await this.profile.writeState({ + ...state, + splashcatApiKey: key, + }); + } out.push(new SplashcatExporter({ env: this.env, uploadMode: this.opts.monitor ? "Monitoring" : "Manual",