I like trying out new things quite frequently and often times these tools are packed in an archive file. But I’m in constant fear whenever I am to unpack those archives because sometimes there are hundreds of files and the person who packed them wouldn’t even do the bare minimum of nesting them inside a directory.

Dolphin (file explorer) had a useful thing where it would detect whether the contents are already nested and if they are not only then it would nest them inside a directory. I tried searching for something similar for the CLI but couldn’t find anything so here it is. Another benefit is that it supports .zip, .tar.xz, .tar.gz simultaneously so I don’t need to deal with manpages of unzip, tar thousand times just because I keep forgetting how to use them. Now it’s just vert x file.zip.

I can add support for a few more formats but I don’t feel the need at least for now (PRs welcome).

  • TriflingToad@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    15
    ·
    3 days ago

    So it detects if there’s a single folder inside the zip containing all the files or all the files directly inside the zip? That’s useful!

    Reminds me of Minecraft texture packs back in the day where nobody really understand how to make a texture pack and all used Ms paint and this was a common issue as clicking “add to .zip” on the folder would make a containing folder and not work. This would mean each user would have to extract it and have folders in their resource pack folder instead of zips.
    This… worked, but when the client(basically a large QOL mod) ~50% of people used added the ability to put texture packs in folders to organize them it treated the unzipped packs like a folder so they stopped working.

    • myxi@toast.oooOP
      link
      fedilink
      English
      arrow-up
      6
      ·
      edit-2
      3 days ago

      So it detects if there’s a single folder inside the zip containing all the files or all the files directly inside the zip?

      Yes. It also has l (lowercase L) subcommand which lists the contents of the archives to the terminal (stdout).

    • Albbi@lemmy.ca
      link
      fedilink
      arrow-up
      3
      ·
      3 days ago

      but when the client(basically a large QOL mod)

      I think you a word. Did you mean when the client updated?