Desktop: fix bug when not creating config dir
This commit is contained in:
parent
2fdea72702
commit
a5e7a5a5f5
2 changed files with 7 additions and 4 deletions
8
desktop/src-tauri/Cargo.lock
generated
8
desktop/src-tauri/Cargo.lock
generated
|
|
@ -1867,7 +1867,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "librqbit"
|
||||
version = "5.0.0-beta.1"
|
||||
version = "5.0.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"axum",
|
||||
|
|
@ -1933,7 +1933,7 @@ version = "2.2.1"
|
|||
|
||||
[[package]]
|
||||
name = "librqbit-core"
|
||||
version = "3.3.0"
|
||||
version = "3.4.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"directories",
|
||||
|
|
@ -1953,7 +1953,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "librqbit-dht"
|
||||
version = "5.0.0-beta.1"
|
||||
version = "5.0.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"backoff",
|
||||
|
|
@ -1978,7 +1978,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "librqbit-peer-protocol"
|
||||
version = "3.3.0"
|
||||
version = "3.4.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bincode",
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ mod config;
|
|||
use std::{
|
||||
fs::{File, OpenOptions},
|
||||
io::{BufReader, BufWriter},
|
||||
path::Path,
|
||||
sync::Arc,
|
||||
};
|
||||
|
||||
|
|
@ -49,6 +50,8 @@ fn read_config(path: &str) -> anyhow::Result<RqbitDesktopConfig> {
|
|||
}
|
||||
|
||||
fn write_config(path: &str, config: &RqbitDesktopConfig) -> anyhow::Result<()> {
|
||||
std::fs::create_dir_all(Path::new(path).parent().context("no parent")?)
|
||||
.context("error creating dirs")?;
|
||||
let tmp = format!("{}.tmp", path);
|
||||
let mut tmp_file = BufWriter::new(
|
||||
OpenOptions::new()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue