Skip to content

Commit

Permalink
feat: use current_dir instead of /var/lib (#260)
Browse files Browse the repository at this point in the history
* refactor: clean `DEFAULT_CONFIG`

* fix: use `current_dir` for persistence
  • Loading branch information
de-sh authored Aug 1, 2023
1 parent a501350 commit be8e019
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 4 additions & 1 deletion uplink/src/base/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::env::current_dir;
use std::path::PathBuf;
use std::time::{SystemTime, UNIX_EPOCH};
use std::{collections::HashMap, fmt::Debug};
Expand Down Expand Up @@ -34,7 +35,9 @@ fn default_file_size() -> usize {
}

fn default_persistence_path() -> PathBuf {
PathBuf::from("/var/lib/uplink")
let mut path = current_dir().expect("Couldn't figure out current directory");
path.push(".persistence");
path
}

pub fn clock() -> u128 {
Expand Down
3 changes: 0 additions & 3 deletions uplink/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,6 @@ pub mod config {
keep_alive = 30
network_timeout = 30
# Create empty streams map
[streams]
# Downloader config
[downloader]
actions = []
Expand Down

0 comments on commit be8e019

Please sign in to comment.