3 # Script for generating .game files
5 # generate game support files
6 # Expects params (game, game path_prefix)
10 if [ $# -lt 2 ] ; then
11 echo "Incorrect number of params to GenGameFiles";
15 # NOTE: the naming of the vars here doesn't follow attributes names in XML, it can be confusing
17 INPUT_FILE="games/$game.game";
18 game_engine=`grep "enginepath_linux=" $INPUT_FILE | awk -F"\"" '{print $2 }'`
19 game_engine_path=$SETUP_COMPONENT_PATH;
21 OUT_FILE="$game_tools/games/$game.game";
23 echo -e "Generating game file '$OUT_FILE' from '$INPUT_FILE' with the following values...";
24 echo -e "\tGame :\t $game";
25 echo -e "\tGame Engine :\t $game_engine_path/$game_engine";
26 echo -e "\tGame Tools :\t $game_tools";
28 if [ -f "$OUT_FILE" ] ; then
32 if [ ! -d "$game_tools/games" ] ; then
33 mkdir "$game_tools/games";
36 sed -e 's!enginepath_linux=\".*.\"!enginepath_linux=\"'$game_engine_path'\"\n gametools=\"'$game_tools/$game'\"!g' <$INPUT_FILE >$OUT_FILE