Make gcp option infallible if the env vars are missing · foundry-rs/foundry@e2f5814 (original) (raw)

File tree

1 file changed

lines changed

1 file changed

lines changed

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
1 1 use clap::Parser;
2 2 use eyre::Result;
3 +use std::env;
3 4
4 5 use foundry_common::fs;
5 6 use foundry_config::Config;
@@ -54,7 +55,7 @@ impl ListArgs {
54 55 .mnemonic_indexes(Some(vec![0]))
55 56 .trezor(self.trezor |
56 57 .aws(self.aws |
57 -.gcp(self.gcp |
58 +.gcp(self.gcp |
58 59 .interactives(0)
59 60 .build()
60 61 .expect("build multi wallet");
@@ -114,3 +115,10 @@ impl ListArgs {
114 115 Ok(())
115 116 }
116 117 }
118 +
119 +fn gcp_env_vars_set() -> bool {
120 +let required_vars =
121 +["GCP_PROJECT_ID", "GCP_LOCATION", "GCP_KEY_RING", "GCP_KEY_NAME", "GCP_KEY_VERSION"];
122 +
123 + required_vars.iter().all(|&var
124 +}