Browse Source

fix output path generation

master
Jonathan Strong 2 years ago
parent
commit
7bb2717612
  1. 2
      Cargo.lock
  2. 2
      Cargo.toml
  3. 7
      src/main.rs

2
Cargo.lock generated

@ -1323,7 +1323,7 @@ checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244"
[[package]]
name = "registry-backup"
version = "0.4.0-rc.1"
version = "0.4.0-rc.2"
dependencies = [
"chrono",
"clap",

2
Cargo.toml

@ -1,7 +1,7 @@
[package]
name = "registry-backup"
authors = ["Jonathan Strong <jstrong@shipyard.rs>"]
version = "0.4.0-rc.1"
version = "0.4.0-rc.2"
edition = "2021"
publish = ["shipyard-rs-public"]
readme = "README.md"

7
src/main.rs

@ -617,7 +617,12 @@ async fn download_versions(
// TODO actually parse and use the format
let url =
url::Url::parse(&registry_config.get_dl_url(&vers.name, &vers.vers, &vers.cksum))?;
let output_path = config.output.path.join(url.path());
//let output_path = config.output.path.join(format!("{}/{}/download", vers.name, vers.vers));
assert!(
url.path().starts_with('/'),
"sanity check in case there are unforseen exceptions to this"
);
let output_path = config.output.path.join(&url.path()[1..]);
if config.dry_run {
debug!(%url, "skipping download (--dry-run mode)");

Loading…
Cancel
Save