fix(api): Windows env hint + .env file loading fallback

When API key missing on Windows, hint about setx. Load .env from CWD
as fallback with simple key=value parser.
This commit is contained in:
YeonGyu-Kim
2026-04-07 14:21:53 +09:00
parent 8d866073c5
commit f982f24926
4 changed files with 161 additions and 9 deletions

View File

@@ -732,7 +732,7 @@ fn now_unix_timestamp() -> u64 {
fn read_env_non_empty(key: &str) -> Result<Option<String>, ApiError> {
match std::env::var(key) {
Ok(value) if !value.is_empty() => Ok(Some(value)),
Ok(_) | Err(std::env::VarError::NotPresent) => Ok(None),
Ok(_) | Err(std::env::VarError::NotPresent) => Ok(super::dotenv_value(key)),
Err(error) => Err(ApiError::from(error)),
}
}