putz u in dhe washing machin and spins ur bsky pofile pictuer !!! :D
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

function for getting env vars

did:plc:73gqgbnvpx5syidcponjri… 341d3f94 67a4ab56

verified
+15 -20
+1
.gitignore
··· 1 1 /target 2 2 /input 3 + .statefile
+1 -1
.statefile
··· 1 - 353 1 + 357
+13 -19
src/main.rs
··· 128 128 println!("successfully updated avatar"); 129 129 } 130 130 131 + fn required_env(var: &str, exe: &str) -> String { 132 + match env::var(var) { 133 + Ok(v) if !v.trim().is_empty() => v, 134 + _ => { 135 + eprintln!("env variable {} not set or empty", var); 136 + print_usage(exe); 137 + process::exit(1); 138 + } 139 + } 140 + } 141 + 131 142 #[tokio::main] 132 143 async fn main() { 133 144 let mut args = env::args(); ··· 142 153 }; 143 154 let output = args.next(); 144 155 145 - let app_password = env::var("APP_PASSWORD").unwrap_or_else(|_| { 146 - eprintln!("environment variable APP_PASSWORD not set"); 147 - print_usage(&executable); 148 - String::new() 149 - }); 150 - if app_password.trim().is_empty() { 151 - eprintln!("APP_PASSWORD is empty"); 152 - process::exit(1); 153 - } 154 - 155 - let identifier = env::var("IDENTIFIER").unwrap_or_else(|_| { 156 - eprintln!("environment variable IDENTIFIER not set"); 157 - print_usage(&executable); 158 - String::new() 159 - }); 160 - if identifier.trim().is_empty() { 161 - eprintln!("IDENTIFIER is empty"); 162 - process::exit(1); 163 - } 156 + let app_password = required_env("APP_PASSWORD", &executable); 157 + let identifier = required_env("IDENTIFIER", &executable); 164 158 165 159 let (session, auth) = MemoryCredentialSession::authenticated( 166 160 identifier.to_cowstr(),