raze/polymer/eduke32/source/lunatic/util/findmaps.sh
helixhorned f64fdf3384 Add foreachmap.lua module 'colenemy', allow passing module name to findmaps.sh.
The 'colenemy' module searches for colored enemies in maps, excluding pal-21
liztroops. DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4056 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-10 19:17:06 +00:00

34 lines
653 B
Bash
Executable file

#!/bin/bash
ok=yes
if [ -z "$1" ]; then
ok=
fi
if [ -z "$2" ]; then
ok=
fi
if [ -z "$ok" ]; then
echo "Usage: $0 <dir> <some_foreachmap_module.lua | code for foreachmap.lua -e>"
exit 1
fi
LOPT=-L
idx=$(expr match `uname -s` '[mM][iI][nN][gG][wW]')
if [ "$idx" != 0 ]; then
LOPT=
fi
FN="$1"
ARG="$2"
idx=$(expr match "$ARG" '.*lua$')
if [ "$idx" == 0 ]; then
ARG="-e$ARG"
find $LOPT "$FN" -iname '*.map' -print0 | xargs -0 ./foreachmap.lua "$ARG"
else
shift
# So that you can e.g. do
# ./findmaps.sh ~/.eduke32 ./colenemy.lua -u
find $LOPT "$FN" -iname '*.map' -print0 | xargs -0 ./foreachmap.lua "$@"
fi