I've discovered a limitation when using the --if-changed
flag with butler. When pushing a directory (not an archive file), the flag only detects modifications to existing files, but fails to detect newly added files.
For example, in our project workflow:
- We push a directory to itch.io using
butler push /path/to/dir username/game:channel --if-changed
- Later, we add new files to the directory without changing any existing files
- When we run the same command again, butler reports no changes and skips the upload
This creates problems for us because new content isn't being uploaded despite the directory having genuinely changed.
Is this the intended behavior? If so, are there any recommended approaches for detecting all changes, including new files, without having to force a full upload every time?
We've implemented a workaround by calculating a directory hash ourselves that includes file paths, sizes, and modification times, but it would be helpful to know if there's a built-in solution we're missing.