Closed pancelor closed 2 years ago
ah my bad; when minify is empty --count "$MINIFY" --script
becomes --count "" --script
, and the argparser (correctly) wonders "uhhh why did you pass me an empty string there in the middle?"
removing the quotes works as expected:
#!/usr/bin/env bash
# usage:
# ./compress.sh # build + minify
# ./compress.sh 1 # build only
MINIFY="--minify"
if [[ -n "$1" ]]; then
echo "skipping minification..."
MINIFY=""
fi
/w/shrinko8/shrinko8.py game.p8 tower.p8.png --lint --count $MINIFY --script compress_combine.py
whoops -- I should have looked into this more before opening an issue!
not-working script:
when I
./compress.sh
, shrinko8 runs normally. when I./compress.sh 1
, it shows the usage string and saysshrinko8.py: error: unrecognized arguments:
, which is unexpected (I expect it to run normally)I assume the problem is because the command ends up having two spaces in it, which confuses the argument parser, but I haven't looked into it.
My shrinko8 commit hash is 8a4f6e0
workaround: