Skip to content

Commit

Permalink
Make the CLI respect the --token flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-F-Bryan committed Jun 26, 2023
1 parent 77898a7 commit 0a74dda
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/registry/src/wasmer_env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ impl WasmerEnv {

/// The API token for the active registry.
pub fn token(&self) -> Option<String> {
if let Some(token) = &self.token {
return Some(token.clone());
}

// Fall back to the config file

let config = self.config().ok()?;
let login = config.registry.current_login()?;
Some(login.token.clone())
Expand Down

0 comments on commit 0a74dda

Please sign in to comment.