Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
Merge pull request #23 from golemcloud/home_dir
Browse files Browse the repository at this point in the history
home dir
  • Loading branch information
adamgfraser committed Sep 12, 2023
2 parents 500cffc + 09fee39 commit 7382154
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 4 deletions.
52 changes: 50 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ tracing = "0.1.37"
tungstenite = "0.20.0"
url = "2.4.1"
uuid = "1.4.1"
dirs = "5.0.1"
10 changes: 8 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use golem_examples::model::{ExampleName, GuestLanguage, GuestLanguageTier, Packa
use model::*;
use reqwest::Url;
use serde::Serialize;
use tracing::debug;
use uuid::Uuid;

use crate::account::{AccountHandler, AccountHandlerLive, AccountSubcommand};
Expand Down Expand Up @@ -244,10 +245,15 @@ async fn async_main(cmd: GolemCommand) -> Result<(), Box<dyn std::error::Error>>
let url_str =
std::env::var("GOLEM_BASE_URL").unwrap_or("https://release.api.golem.cloud/".to_string());
let url = Url::parse(&url_str).unwrap();
let home = std::env::var("HOME").unwrap();
let home = dirs::home_dir().unwrap();
let allow_insecure_str = std::env::var("GOLEM_ALLOW_INSECURE").unwrap_or("false".to_string());
let allow_insecure = allow_insecure_str != "false";
let default_conf_dir = PathBuf::from(format!("{home}/.golem"));
let default_conf_dir = home.join(".golem");

debug!(
"Golem configuration directory: {}",
default_conf_dir.display()
);

let login = LoginClientLive {
login: golem_client::login::LoginLive {
Expand Down

0 comments on commit 7382154

Please sign in to comment.