feat: goose windows (#880)

Co-authored-by: Ryan Versaw <ryan@versaw.com>
This commit is contained in:
Max Novich
2025-02-10 15:05:13 -08:00
committed by GitHub
parent 98aecbef23
commit cfd3ee8fd9
43 changed files with 1327 additions and 456 deletions
+3
View File
@@ -66,6 +66,9 @@ aws-config = { version = "1.1.7", features = ["behavior-version-latest"] }
aws-smithy-types = "1.2.12"
aws-sdk-bedrockruntime = "1.72.0"
[target.'cfg(target_os = "windows")'.dependencies]
winapi = { version = "0.3", features = ["wincred"] }
[dev-dependencies]
criterion = "0.5"
tempfile = "3.15.0"
+5 -1
View File
@@ -32,7 +32,11 @@ struct TokenCache {
fn get_base_path() -> PathBuf {
const BASE_PATH: &str = ".config/goose/databricks/oauth";
let home_dir = std::env::var("HOME").expect("HOME environment variable not set");
let home_dir = if cfg!(windows) {
std::env::var("USERPROFILE").expect("USERPROFILE environment variable not set")
} else {
std::env::var("HOME").expect("HOME environment variable not set")
};
PathBuf::from(home_dir).join(BASE_PATH)
}