Skip to content

Commit

Permalink
feat: windows receipt support
Browse files Browse the repository at this point in the history
  • Loading branch information
mistydemeo committed Jan 24, 2024
1 parent e67a961 commit e43c1ea
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
use std::env::{self, args, current_dir};
use std::{
env::{self, args, current_dir},
path::PathBuf,
};

#[cfg(unix)]
use std::{fs::File, os::unix::fs::PermissionsExt};
Expand Down Expand Up @@ -428,7 +431,12 @@ pub fn get_config_path(app_name: &String) -> AxoupdateResult<Utf8PathBuf> {
if env::var("AXOUPDATER_CONFIG_WORKING_DIR").is_ok() {
Ok(Utf8PathBuf::try_from(current_dir()?)?)
} else {
let Some(home) = homedir::get_my_home()? else {
let home = if cfg!(windows) {
env::var("LOCALAPPDATA").map(PathBuf::from).ok()
} else {
homedir::get_my_home()?
};
let Some(home) = home else {
return Err(AxoupdateError::NoHome {});
};

Expand Down

0 comments on commit e43c1ea

Please sign in to comment.