Skip to content

Commit

Permalink
chore!: use local data dir for downloaded assets (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
orhun committed Dec 12, 2023
1 parent 73b02f0 commit d33d77f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/src/constant.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pub const DATA_DIR: &str = ".spicylauncher";
pub const DATA_DIR: &str = "spicy-launcher";
pub const TEMP_DOWNLOAD_DIR: &str = "spicylauncher-downloads";
4 changes: 2 additions & 2 deletions core/src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ pub struct LocalStorage {
impl LocalStorage {
pub fn init() -> Result<Self> {
let temp_dir = env::temp_dir().join(TEMP_DOWNLOAD_DIR);
let data_dir = dirs_next::home_dir()
.ok_or_else(|| Error::Storage(String::from("home directory not found")))?
let data_dir = dirs_next::data_local_dir()
.ok_or_else(|| Error::Storage(String::from("local data directory not found")))?
.join(DATA_DIR);
for path in &[&temp_dir, &data_dir] {
if !path.exists() {
Expand Down

0 comments on commit d33d77f

Please sign in to comment.