mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-08-08 06:22:39 -04:00
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
c0501627c9
commit
b0ffeeab1d
5 changed files with 43 additions and 29 deletions
|
@ -1,5 +1,5 @@
|
|||
use crate::fs::default_data_dir;
|
||||
use anyhow::{Context, Result};
|
||||
use directories_next::ProjectDirs;
|
||||
use libp2p::core::Multiaddr;
|
||||
use libp2p::PeerId;
|
||||
use std::path::PathBuf;
|
||||
|
@ -134,9 +134,16 @@ pub struct MoneroParams {
|
|||
#[derive(Clone, Debug)]
|
||||
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/
|
||||
impl Default for Data {
|
||||
fn default() -> Self {
|
||||
Data(default_data_dir().expect("computed valid path for data dir"))
|
||||
Data(
|
||||
ProjectDirs::from("", "", "xmr-btc-swap-cli")
|
||||
.map(|proj_dirs| proj_dirs.data_dir().to_path_buf())
|
||||
.expect("computed valid path for data dir"),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue