itchio / butler

🎩 Command-line itch.io helper
MIT License
745 stars 52 forks source link

Consider adding `--force-wrap` #187

Open fasterthanlime opened 5 years ago

fasterthanlime commented 5 years ago

Right now, if you do

butler push ./some-dir user/game:channel

Then the resulting archive will have the contents of that directory, without that directory, so instead of extracting to:

some-dir/
  a
  b
  c

It'll extract to

a
b
c

ie. it's a "tarbomb".

Adding a --force-wrap option could force butler to consider the contents to be "the parent folder if it only contained some-dir". All the code's already there, so it's "just as simple" as adding the CLI argument, and it's a backwards-compatible change.

On the app side (well, also butler) - we might need to change our .itch.toml lookup routines.

Currently it only looks at the top-level, but if there's nothing there we might want to also look in any subfolders, excluding .itch. This is sorta confusing, but that's the only way to let --force-wrap games ship manifests.