Created
September 9, 2022 14:30
-
-
Save eguneys/8fdbc2a2cfb1bb2ab45a0961b454aef9 to your computer and use it in GitHub Desktop.
Build Aseprite Copy into folder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
FOLDER=$1 | |
OUT=$2 | |
OPTIPNG="/mnt/d/programs/optipng-0.7.7-win32/optipng.exe" | |
ASEPRITE="/mnt/c/Program Files/Aseprite/aseprite.exe" | |
files="sprites | |
sprites2 | |
font_sprites" | |
if [[ $FOLDER == "" || ! -d $FOLDER || $OUT == "" ]]; then | |
echo "usage: ./save.sh folder outdir" | |
exit | |
fi | |
for filename in $files | |
do | |
file="$FOLDER/$filename.aseprite" | |
if [ -f "$file" ]; then | |
"$ASEPRITE" -b $file --save-as $FOLDER/export/$filename.png | |
"$OPTIPNG" -o7 $FOLDER/export/$filename.png | |
else | |
echo "skipping $file" | |
fi | |
done | |
scp $FOLDER/export/*.png $OUT/assets |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment