freecol/bin/fsgunpack.sh

23 lines
474 B
Bash
Raw Permalink Normal View History

2013-02-12 02:10:12 +01:00
#! /bin/sh
# fsgunpack.sh
# Unpack fsg file.
#
# Usage:
# fsgunpack <fsgfile>...
2015-05-14 12:06:07 +02:00
for f in ${1+"$@"} ; do
case "x$f" in
2018-12-28 03:35:06 +01:00
x*.fsg) EXT=fsg ;;
x*.fsm) EXT=fsm ;;
2015-05-14 12:06:07 +02:00
*) echo "not an fsg file: $f" >&2 ; exit 1 ;;
2013-02-12 02:10:12 +01:00
esac
2018-12-28 03:35:06 +01:00
n=`basename "$f" ."$EXT"`
2013-02-12 02:10:12 +01:00
mkdir "$n" || exit $?
2015-05-14 12:06:07 +02:00
cp "$f" "$n"
2013-02-12 02:10:12 +01:00
(cd "$n" ;\
2018-12-28 03:35:06 +01:00
unzip "$n.$EXT" 1> /dev/null ;\
rm -f "$n.$EXT" ;\
2013-02-13 04:19:12 +01:00
for s in *.xml ; do xml_pp -i "$s" 2> /dev/null ; done) || exit $?
2013-02-12 02:10:12 +01:00
done
exit 0