From 1e4ea3405d5028a416c2d79d98687ae65d4a9dd5 Mon Sep 17 00:00:00 2001 From: "Christopher L. Crutchfield" Date: Mon, 9 Dec 2024 23:53:42 -0800 Subject: [PATCH] fix: remove the file after upload. --- src/subcommands/main_subcommand.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/subcommands/main_subcommand.rs b/src/subcommands/main_subcommand.rs index 24566e0..fb0a5e3 100644 --- a/src/subcommands/main_subcommand.rs +++ b/src/subcommands/main_subcommand.rs @@ -132,15 +132,15 @@ impl CustomTransferAgent for MainSubcommand { return Ok(()) } + let file_station = self.file_station.clone().context("File Station should not be null")?; + file_station.upload(source_path, event.size.context("Size should not be null")?, configuration.path.as_str(), false, false, None, None, None, Some(progress_reporter)).await?; + // Remove the path if the compressed source path is not the same as the source path provided by git lfs. if event_source_path != compressed_source_path { let path = Path::new(&compressed_source_path); remove_file(path).await?; } - let file_station = self.file_station.clone().context("File Station should not be null")?; - file_station.upload(source_path, event.size.context("Size should not be null")?, configuration.path.as_str(), false, false, None, None, None, Some(progress_reporter)).await?; - info!("Upload finished."); Ok(()) }