Skip to content

Commit

Permalink
Only get project ID for authorized user if getting a token worked
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed May 27, 2024
1 parent 20f2ae7 commit 9bc6144
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gcloud_authorized_user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ impl GCloudAuthorizedUser {
/// Check if `gcloud` is installed and logged in
pub async fn new() -> Result<Self, Error> {
debug!("try to print access token via `gcloud`");
let project_id = run(&["config", "get-value", "project"]).ok();
let token = RwLock::new(Self::fetch_token()?);
let project_id = run(&["config", "get-value", "project"]).ok();
Ok(Self {
project_id: project_id.map(Arc::from),
token,
Expand Down

0 comments on commit 9bc6144

Please sign in to comment.