aboutsummaryrefslogtreecommitdiff
path: root/tools/optimize-assets.sh
blob: a9b28886487764de941380747ac8829b7681ac6d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
#!/bin/sh -e

# SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later

which optipng || exit
NPROC=$(nproc 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 4)

# shellcheck disable=SC2038
find . -type f -iname '*.png' | xargs -P "$NPROC" -I {} optipng -o7 {}