mirror of
https://codeberg.org/demostf/mover.git
synced 2026-06-03 18:04:08 +02:00
dont actually check for hash mismatch
since at this point this is the only copy there isn't anything we can do to fix any mismatch
This commit is contained in:
parent
79a7781db4
commit
e8ddda506f
1 changed files with 2 additions and 14 deletions
16
src/main.rs
16
src/main.rs
|
|
@ -101,16 +101,6 @@ async fn move_demo(
|
|||
if target_path.is_file() {
|
||||
warn!("target exists");
|
||||
} else {
|
||||
let calculated_hash = hash(&source_path)?;
|
||||
if calculated_hash != demo.hash {
|
||||
error!(
|
||||
calculated = debug(calculated_hash),
|
||||
stored = debug(demo.hash),
|
||||
"hash mismatch for source"
|
||||
);
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
create_dir_all(target_path.parent().unwrap())?;
|
||||
|
||||
copy(&source_path, &target_path)?;
|
||||
|
|
@ -119,13 +109,11 @@ async fn move_demo(
|
|||
let calculated_hash = hash(&target_path)?;
|
||||
|
||||
if calculated_hash != demo.hash {
|
||||
error!(
|
||||
warn!(
|
||||
calculated = debug(calculated_hash),
|
||||
stored = debug(demo.hash),
|
||||
"hash mismatch for target"
|
||||
);
|
||||
remove_file(&target_path)?;
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
info!("renamed");
|
||||
|
|
@ -135,7 +123,7 @@ async fn move_demo(
|
|||
target_backend,
|
||||
&demo.path,
|
||||
&demo.url,
|
||||
calculated_hash,
|
||||
demo.hash,
|
||||
api_key,
|
||||
)
|
||||
.await
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue