First of all, thanks to CamDawg for compiling this tutorial and for helping to make all the G3 mods Mac-friendly! All four of us that download and use them are extremely appreciative!
Second, I'd like to give a (hopefully) better solution for listing all the .ogg files in the .command script. I'm going to assume that the reasoning behind listing the files in the ogg_files variable is for two reasons: expansion of wildcards doesn't work with sox (as stated in the tutorial) and that you only want to affect the .ogg files used by this particular mod (not all .oggs by any mod). While listing all the oggs will work, there is a much simpler way of doing it that will save on potential install issues from spelling errors.
#!/bin/sh
ogg_files=`ls path/to/audio/folder | grep '.ogg'`
for file in $ogg_files; do
echo Converting $file...
path/to/sox path/to/audio/folder/$file override/${file%.ogg}.wav
done
Notice the backquotes used in the ogg_files variable (same key as the tilde). They tell the script to use the output of this unix command. This will simply make a listing of all the files in your mod's audio folder that have .ogg in the filename, thus eliminating the need to manually type each one. For uninstalling the wavs, you will need a slightly modified version:
#!/bin/sh
wav_files=`ls path/to/audio/folder | grep '.ogg' | sed s/.ogg/.wav/g`
for file in $wav_files; do
if [ -e override/$file ]; then
echo Removing $file...
rm -f override/$file
fi
done
This time, the script took the list from the audio folder and substituted the .wav suffix (instead of .ogg). Then, it checked for the existence of the file in the override folder before deleting each one.
Finally, I have run into a problem with early versions of OSX that makes the script choke. The problem comes from the fact that it runs as if located at the root of the system (which isn't where BG2 is!). To compensate for this problem, you can simply add this snippet to the top of the script:
#!/bin/sh
command_path=${0%/*}
cd "$command_path"
# rest of the script below...
I use this in all my scripts that must affect files relative to the script's location (such as installing the mod/ogg/tiz, etc). It simply assigns the absolute path of this script's location to the $command_path variable, then cd's to it. Makes life easier for the tech support people...