itchio / butler

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

Butler ignore seems broken #185

Closed zcanann closed 5 years ago

zcanann commented 5 years ago

I haven't been able to successfully get this to ignore any files, and some glob patterns seem to cause crashes.

Am I using the wrong syntax? What would be an example of ignoring both .pdb files and .dSYM files?

fasterthanlime commented 5 years ago

@zcanann can you give me an example argument that causes a crash?

The feature is relatively simple: every --ignore PATTERN argument gets added to this array:

https://github.com/itchio/butler/blob/544e1b8609f8dab386cc67cd06bf999e47029b28/filtering/filtering.go#L8-L17

filepath.Match is used to actually filter paths:

https://github.com/itchio/butler/blob/544e1b8609f8dab386cc67cd06bf999e47029b28/filtering/filtering.go#L19-L31

The syntax is detailed here: https://godoc.org/path/filepath#Match

I'm very interested in reproducing the crashes (assuming they're actually crashes, not just invalid pattern syntax - but even then, maybe a better error message and better documentation could be added)

zcanann commented 5 years ago

Ah! User error. I was passing -ignore instead of --ignore, and it was causing crazy errors.

I managed to figure out that you can pass the --ignore command multiple times, ie butler push --ignore=*.pdb --ignore=*.dSYM

That part wasn't intuitive to me, I think a couple examples under https://itch.io/docs/butler/pushing.html would go a long way!

Apologies for filing an invalid issue, thanks for the help!

fasterthanlime commented 5 years ago

@zcanann I've added a bunch of documentation, including --ignore examples, here: https://itch.io/docs/butler/pushing.html

zcanann commented 5 years ago

Awesome! I appreciate you taking the time to do this.

benblo commented 5 years ago

@zcanann I've added a bunch of documentation, including --ignore examples, here: https://itch.io/docs/butler/pushing.html

FYI, the doc says to use eg --ignore '*.ext', with quotes, but (at least on Windows 10) that syntax doesn't work, I had to use instead --ignore *.ext (no quotes)

elvisish commented 7 months ago

@zcanann I've added a bunch of documentation, including --ignore examples, here: https://itch.io/docs/butler/pushing.html

FYI, the doc says to use eg --ignore '*.ext', with quotes, but (at least on Windows 10) that syntax doesn't work, I had to use instead --ignore *.ext (no quotes)

@zcanann can you update the docs to mention that Windows shouldn't use quotes in the --ignore command?