All pastes #473527 Raw Edit

Stuff

public shellscript v1 · immutable
·published 2007-05-06 09:31 UTC
rendered paste body
#!/bin/bashEXT=pk3VERSION=0.1#default valuesUPDATE=1VERBOSE=0GenPK3_Usage(){    echo "Usage: $0 mapname (without extension)"    exit 1}if ! test -d "./maps"; then	echo "$0 must be in the base dir"	exit 1fiwhile truedo    case "$1" in    --version | -v)	echo GenPK3 version $VERSION	exit 0	;;    --only-new)	UPDATE=0	shift	;;    --verbose)	VERBOSE=1	shift	;;    *)	break	;;	esacdoneZIP_PARM=-9if test "$UPDATE" == 1; then	ZIP_PARM+=ufiif test "$VERBOSE" == 1; then	ZIP_PARM+=velse	ZIP_PARM+=qfiif test $# -lt 1; then	GenPK3_Usageelse	mapname=`basename "$1"`	echo "Generating $mapname.pk3"	echo ".. zip options: $ZIP_PARM"	for daynight in `echo "d n"`; do		if test -f "maps/$1$daynight.bsp"; then			if test -f "maps/$1$daynight.map"; then				zip $ZIP_PARM $mapname.$EXT maps/$1$daynight.map maps/$1$daynight.bsp			else				echo "$1$daynight.map (source map) does not exist."				exit 1			fi		else			echo "$1$daynight.bsp (compiled map) does not exist."			exit 1		fi	donefi