getsounds.sh: look for a locally-cached copy first

This lets you specify a FS_SOUNDS_DIR in which to look for the sound
tarballs.  This makes it easier to use git clean -fdx without
downloading the sounds every time.
This commit is contained in:
Travis Cross 2012-04-24 04:00:43 +00:00
parent d5766ceaa0
commit 0ec4e82664
1 changed files with 9 additions and 4 deletions

View File

@ -23,10 +23,15 @@ pwd
echo "# $0 $1 $2"
if [ ! -f $tarfile ] ; then
$DOWNLOAD_CMD $base$tarfile
if [ ! -f $tarfile ] ; then
echo cannot find $tarfile
exit 1
if [ -f $FS_SOUNDS_DIR/$tarfile ]; then
test ! cp -l $FS_SOUNDS_DIR/$tarfile . \
|| cp $FS_SOUNDS_DIR/$tarfile .
else
$DOWNLOAD_CMD $base$tarfile
if [ ! -f $tarfile ] ; then
echo cannot find $tarfile
exit 1
fi
fi
fi