Skip to content

Commit

Permalink
Fixes order of login messages
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgilman committed Sep 14, 2021
1 parent e36068e commit 1112d82
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,11 @@ async fn gen_cert(config: &Config, console: &impl Console) -> Result<()> {
// Attempt to load token from file if needed
let token = match config.token.is_none() {
true => {
console.neutral("Using token from ~/.vault-token...");
VaultClient::token_from_file().unwrap_or_else(|_| "".to_string())
let token = VaultClient::token_from_file().unwrap_or_else(|_| "".to_string());
if !token.is_empty() {
console.neutral("Using token from ~/.vault-token...");
}
token
}
false => config.token.as_ref().unwrap().clone(),
};
Expand All @@ -274,10 +277,10 @@ async fn gen_cert(config: &Config, console: &impl Console) -> Result<()> {
}

console.success("Login success!");
} else {
console.success("Valid token found.");
}

console.success("Valid token found.");

// Create certificate
console.neutral("Generating new certificate...");
let contents = load_pub(identity)?;
Expand Down

0 comments on commit 1112d82

Please sign in to comment.