From a247a0524716e9f38131882e275db2a2f60b84e5 Mon Sep 17 00:00:00 2001 From: RandumKiwi Date: Sat, 12 Jan 2013 10:44:36 +0000 Subject: [PATCH] Handy shell script... git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7069 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- packages/convert_mapcfgs.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 packages/convert_mapcfgs.sh diff --git a/packages/convert_mapcfgs.sh b/packages/convert_mapcfgs.sh new file mode 100644 index 00000000..a5888f20 --- /dev/null +++ b/packages/convert_mapcfgs.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# A simple script using SED to make map configs +# compatible with the new layout. + +while getopts "c:" copt; do + if [ "$copt" = "c" ]; then + if [ -e "$OPTARG" ]; then + echo "Converting your map cfg file..." + echo -e "\nConverting mapmodels..." + sed -i 's/laptop1/jcdpc\/laptop/g' $OPTARG + sed -i 's/rattrap\/cbbox/jcdpc\/cardboardbox/g' $OPTARG + sed -i 's/rattrap\/hanginlamp/jcdpc\/hanginglamp/g' $OPTARG + sed -i 's/rattrap\/ventflap/jcdpc\/ventflap/g' $OPTARG + sed -i 's/rattrap\/milkcrate2/ratboy\/toca_milkcrate_blue/g' $OPTARG + sed -i 's/rattrap\/milkcrate1/ratboy\/toca_milkcrate_red/g' $OPTARG + echo -e "\a\nConversion finished!" + else + echo -e "\a\E[31m\033[1mERROR:\E[0m The path you've stated to the map config file is invalid." + fi + else + echo -e "\a\E[31m\033[1mERROR:\E[0m Invalid OPTION" + echo -e "Try running this script with the -c option, specifying the path to your maps config file." + fi +done