39 lines
726 B
Bash
Executable file
39 lines
726 B
Bash
Executable file
#!/bin/sh
|
|
|
|
# ensure we use the tools provided in ./bin
|
|
export PATH="$(pwd)/Tools:$PATH"
|
|
|
|
CWD=$(pwd)
|
|
|
|
# build src/files.dat
|
|
dump_filelist()
|
|
{
|
|
|
|
FILE_F="$CWD/$1/src/files_f.dat"
|
|
FILE="$CWD/$1/src/files.dat"
|
|
rm -v "$FILE"
|
|
|
|
cd "$CWD/$1/src/"
|
|
grep -r Precache_Sound\(\ \" | cut -d '"' -f 2 | awk '{ print "sound/"$1; }' > "$FILE_F"
|
|
grep -r Precache_Model\(\ \" | cut -d '"' -f 2 >> "$FILE_F"
|
|
grep -r Precache_File\(\ \" | cut -d '"' -f 2 >> "$FILE_F"
|
|
|
|
# print the counter for sounds
|
|
FIL_COUNT=$(cat "$FILE_F" | wc -l)
|
|
|
|
if [ -z "$FIL_COUNT" ]
|
|
then
|
|
FIL_COUNT="0"
|
|
fi
|
|
|
|
# misc files
|
|
echo "$FIL_COUNT" >> "$FILE"
|
|
cat "$FILE_F" | while read LINE
|
|
do
|
|
echo "1 $LINE" >> "$FILE"
|
|
done
|
|
|
|
rm -v "$FILE_F"
|
|
}
|
|
|
|
dump_filelist $1
|