prompt for api key

splashcat-exporter
Rosalina 2023-12-03 17:53:13 -05:00
parent 0352665076
commit 07ac720d73
No known key found for this signature in database
1 changed files with 13 additions and 0 deletions

View File

@ -244,6 +244,19 @@ export class App {
} }
if (exporters.includes("splashcat")) { 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({ out.push(new SplashcatExporter({
env: this.env, env: this.env,
uploadMode: this.opts.monitor ? "Monitoring" : "Manual", uploadMode: this.opts.monitor ? "Monitoring" : "Manual",