ouch icon indicating copy to clipboard operation
ouch copied to clipboard

Ignore __MACOSX by default

Open jeiea opened this issue 2 years ago • 3 comments

Steps to reproduce

ouch d Archive.zip with the following file.

Archive.zip

Expected behavior

I want it creates Archive directory with a.htm, b.htm.

Actual behavior

It creates __MACOSX directory additionally.

Addtional context

unzip utility also do this, but I think __MACOSX directory is not necessary in most cases.

jeiea avatar Jul 24 '23 00:07 jeiea

:+1: yeah, that would be convenient.

Should we only do it if __MACOSX is the only directory? It's possible for archives to contain other folders alongside it.

marcospb19 avatar Jul 24 '23 15:07 marcospb19

As you say an archive can contain other directories, so how about ignoring that directory when it contains no file? It seems to have empty directories.

jeiea avatar Jul 24 '23 16:07 jeiea

Sorry, I assumed the wrong archive structure.

$ ouch list Archive.zip --tree
Archive: /home/marcospb19/Downloads/Archive.zip
├── b.htm
├── a.htm
└── __MACOSX
   └── ._a.htm

So __MACOSX is actually a folder that might include some content :thinking:.

marcospb19 avatar Jul 24 '23 19:07 marcospb19