Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix optimize_textures.sh #3174

Merged
merged 1 commit into from
Jan 6, 2025
Merged

Fix optimize_textures.sh #3174

merged 1 commit into from
Jan 6, 2025

Conversation

EGYT5453
Copy link
Contributor

@EGYT5453 EGYT5453 commented Jan 5, 2025

I don't know when it stopped working, but now it gives the following error:

find: warning: ‘-name’ matches against basenames only, but the given pattern contains a directory separator (‘/’), thus the expression will evaluate to false all the time. Did you mean ‘-wholename’?

Changing it from find -name '../*.png' to find .. -name '*.png' fixed it for me.

@appgurueu appgurueu merged commit 6da5e94 into luanti-org:master Jan 6, 2025
2 checks passed
@EGYT5453 EGYT5453 deleted the ot.sh branch January 8, 2025 16:46
@SmallJoker
Copy link
Contributor

SmallJoker commented Jan 12, 2025

I suppose this script was intended to be run from the git root like so:

bash util/optimize_textures.sh

A proper solution would be to use

SCRIPT_DIR=`realpath "$(dirname "$0")"`
find "$SCRIPT_DIR/.." -name '*.png' -print0 | xargs -0 optipng -o7 -zm1-9 -nc -strip all -clobber

EDIT2: I think this issue was caused by an untested change resulting from the following comment: #2808 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants