Skip to content

Commit

Permalink
Fix copying files located on the root folder in GCS/S3 buckets (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
abdolence authored Aug 5, 2024
1 parent c77b92d commit fd49e8f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "redacter"
version = "0.3.0"
version = "0.3.1"
edition = "2021"
authors = ["Abdulla Abdurakhmanov <[email protected]>"]
license = "Apache-2.0"
Expand Down
7 changes: 6 additions & 1 deletion src/filesystems/aws_s3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,14 @@ impl<'a> FileSystemConnection<'a> for AwsS3FileSystem<'a> {
fn resolve(&self, file_ref: Option<&FileSystemRef>) -> AbsoluteFilePath {
AbsoluteFilePath {
file_path: if self.is_dir {
let object_name_prefix = if self.object_name == "/" {
""
} else {
self.object_name.as_str()
};
format!(
"{}{}",
&self.object_name,
object_name_prefix,
file_ref
.map(|fr| fr.relative_path.value().clone())
.unwrap_or_default()
Expand Down
7 changes: 6 additions & 1 deletion src/filesystems/gcs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,14 @@ impl<'a> FileSystemConnection<'a> for GoogleCloudStorageFileSystem<'a> {
fn resolve(&self, file_ref: Option<&FileSystemRef>) -> AbsoluteFilePath {
AbsoluteFilePath {
file_path: if self.is_dir {
let object_name_prefix = if self.object_name == "/" {
""
} else {
self.object_name.as_str()
};
format!(
"{}{}",
&self.object_name,
object_name_prefix,
file_ref
.map(|fr| fr.relative_path.value().clone())
.unwrap_or_default()
Expand Down

0 comments on commit fd49e8f

Please sign in to comment.