Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,18 +144,18 @@ async fn run_login(args: LoginArgs, verbose: bool) -> Result<(), String> {
)
.await?;

// 4. Cache credentials
// 4. Cache credentials, or print to stdout when caching is skipped.
// Default path stays quiet so `login` doesn't leak credentials to the terminal.
if args.no_cache {
eprintln!("Skipping credential cache (--no-cache)");
match args.format {
OutputFormat::CredentialProcess => output::print_credential_process(&creds),
OutputFormat::Env => output::print_env(&creds),
}
} else {
let location = cache::write_credentials(&args.role_arn, &creds)?;
eprintln!("Credentials cached to {location}");
}

// 5. Output
match args.format {
OutputFormat::CredentialProcess => output::print_credential_process(&creds),
OutputFormat::Env => output::print_env(&creds),
eprintln!("Run 'source-coop creds' to print them.");
}

Ok(())
Expand Down
Loading