Skip to content

flatten txz file not works when the .DS_Store auto generate #147

Open
@Whirlwind

Description

@Whirlwind

I have a issue, when I download a pod which the pod have a same directory in the tar's root directory.

"source" : {
    "http": "https:/xxxx/xxx.txz",
}

I known the downloader will auto flatten the directory, but it not works.

I debug the source code, and print the contents:

if contents.count == 1 && entry.directory?
tmp_entry = entry.sub_ext("#{entry.extname}.tmp")
begin
FileUtils.move(entry, tmp_entry)
FileUtils.move(tmp_entry.children, target_path)
ensure
FileUtils.remove_entry(tmp_entry)
end
end

I found the contents :

[#<Pathname:/var/folders/d1/cvjyjgt107z00lzykk2n81gc0000gn/T/d20241113-25435-1u8clqa/.DS_Store>, 
#<Pathname:/var/folders/d1/cvjyjgt107z00lzykk2n81gc0000gn/T/d20241113-25435-1u8clqa/VideoPlayer>]

The .DS_Store auto generate and it cause the contents.count != 1!!

I mirror the directory:
image

I known the .DS_Store is generate by Finder, but I don't know why it be generate when I not open any finder.

I think we can filter it when we check the count, right?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions