diff --git a/Cargo.toml b/Cargo.toml index 40e36ae..c3c551b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,7 @@ [workspace] members = [ - "chir-rs-castore", "chir-rs-client", + "chir-rs-castore", + "chir-rs-client", "chir-rs-config", "chir-rs-db", "chir-rs-gemini", @@ -35,7 +36,11 @@ sentry = { version = "0.34.0", default-features = false, features = [ ] } sentry-eyre = "0.2.0" sentry-tracing = { version = "0.34.0", features = ["backtrace"] } -tokio = { version = "1.41.1", features = ["macros", "rt-multi-thread", "signal"] } +tokio = { version = "1.41.1", features = [ + "macros", + "rt-multi-thread", + "signal", +] } tracing = "0.1.41" tracing-error = "0.2.0" tracing-subscriber = { version = "0.3.18", features = ["env-filter", "json"] } @@ -94,9 +99,3 @@ codegen-units = 1 lto = true debug = "full" strip = "none" - -[profile.dev.package."*"] -opt-level = 2 - -[profile.dev] -opt-level = 1 diff --git a/chir-rs-client/src/main.rs b/chir-rs-client/src/main.rs index fbb70fa..6d3be2a 100644 --- a/chir-rs-client/src/main.rs +++ b/chir-rs-client/src/main.rs @@ -9,7 +9,7 @@ use eyre::{eyre, Context as _, OptionExt as _, Result}; use mime_guess::{Mime, MimeGuess}; use reqwest::Body; use tokio::join; -use tracing::instrument; +use tracing::{info, instrument}; #[derive(Parser, Debug)] #[command(version, about, long_about = None)] @@ -92,6 +92,7 @@ async fn upload(url: String, source: impl AsRef, dest: String) -> Result<( .body(Body::from(file)) .send() .await?; + info!("Finished uploading {dest}"); if !res.status().is_success() { let response = res.bytes().await?; let response: APIError = @@ -122,11 +123,10 @@ async fn upload_dir(url: String, source: impl AsRef, dest: String) -> Resu continue; } if file_name_str == "index.html" { - if dest.is_empty() { - upload(url.clone(), ent.path(), "".to_string()).await?; - } else { + if !dest.is_empty() { upload(url.clone(), ent.path(), format!("{dest}/")).await?; } + upload(url.clone(), ent.path(), dest.clone()).await?; } upload(url.clone(), ent.path(), tgt).await?; }