Skip to content

Commit

Permalink
Don't use HOME env var
Browse files Browse the repository at this point in the history
This environment variable doesn't exist on Windows
  • Loading branch information
anaisbetts committed May 15, 2024
1 parent 1695ad5 commit 69cf9c8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions crates/gitbutler-core/src/git/credentials.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ impl Helper {
let path = path.into();
let keys = keys::Controller::from_path(&path);
let users = users::Controller::from_path(path);
let home_dir = std::env::var_os("HOME").map(PathBuf::from);
Self::new(keys, users, home_dir)
Self::new(keys, users, dirs::home_dir())
}

pub fn help<'a>(
Expand Down
4 changes: 1 addition & 3 deletions crates/gitbutler-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
clippy::too_many_lines
)]

use std::path::PathBuf;

use gitbutler_core::{assets, git, storage};
use gitbutler_tauri::{
app, askpass, commands, github, keys, logs, menu, projects, undo, users, virtual_branches,
Expand Down Expand Up @@ -126,7 +124,7 @@ fn main() {
let git_credentials_controller = git::credentials::Helper::new(
keys_controller.clone(),
users_controller.clone(),
std::env::var_os("HOME").map(PathBuf::from)
dirs::home_dir()
);
app_handle.manage(git_credentials_controller.clone());

Expand Down

0 comments on commit 69cf9c8

Please sign in to comment.