mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-08-08 06:22:39 -04:00
!fixup Different default directories for CLI and ASB
Using the same default directory as data-/config-dir has caused unwanted side effects when running both applications on the same machine. Use these directory names: - ASB: xmr-btc-swap/asb - CLI: xmr-btc-swap/cli Since the functionality is now application specific the respective functions were moved into the appropriate module of the application.
This commit is contained in:
parent
b0ffeeab1d
commit
69f7565746
4 changed files with 43 additions and 27 deletions
|
@ -1,8 +1,8 @@
|
|||
use crate::fs::system_data_dir;
|
||||
use anyhow::{Context, Result};
|
||||
use directories_next::ProjectDirs;
|
||||
use libp2p::core::Multiaddr;
|
||||
use libp2p::PeerId;
|
||||
use std::path::PathBuf;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::str::FromStr;
|
||||
use url::Url;
|
||||
use uuid::Uuid;
|
||||
|
@ -135,13 +135,12 @@ pub struct MoneroParams {
|
|||
pub struct Data(pub PathBuf);
|
||||
|
||||
/// Default location for storing data for the CLI
|
||||
// Linux: /home/<user>/.local/share/xmr-btc-swap-cli/
|
||||
// OSX: /Users/<user>/Library/Application Support/xmr-btc-swap-cli/
|
||||
// Takes the default system data-dir and adds a `/cli`
|
||||
impl Default for Data {
|
||||
fn default() -> Self {
|
||||
Data(
|
||||
ProjectDirs::from("", "", "xmr-btc-swap-cli")
|
||||
.map(|proj_dirs| proj_dirs.data_dir().to_path_buf())
|
||||
system_data_dir()
|
||||
.map(|proj_dir| Path::join(&proj_dir, "cli"))
|
||||
.expect("computed valid path for data dir"),
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue