2019-01-22 16:47:32 +08:00
|
|
|
#! /bin/bash
|
|
|
|
|
|
|
|
# ==============================================================================
|
|
|
|
# -- Parse arguments -----------------------------------------------------------
|
|
|
|
# ==============================================================================
|
|
|
|
|
2019-06-11 23:07:45 +08:00
|
|
|
DOC_STRING="Unpack and copy over CarlaUE4's Exported Assets"
|
2019-01-22 16:47:32 +08:00
|
|
|
|
2019-01-25 18:34:41 +08:00
|
|
|
USAGE_STRING="Usage: $0 [-h|--help] [-d|--dir] <outdir>"
|
2019-01-22 16:47:32 +08:00
|
|
|
|
|
|
|
OUTPUT_DIRECTORY=""
|
|
|
|
|
2019-01-25 18:34:41 +08:00
|
|
|
OPTS=`getopt -o h,d:: --long help,dir:: -n 'parse-options' -- "$@"`
|
2019-01-22 16:47:32 +08:00
|
|
|
|
|
|
|
if [ $? != 0 ] ; then echo "$USAGE_STRING" ; exit 2; fi
|
|
|
|
|
|
|
|
eval set -- "$OPTS"
|
|
|
|
|
|
|
|
while true; do
|
|
|
|
case "$1" in
|
|
|
|
--dir )
|
|
|
|
OUTPUT_DIRECTORY="$2"
|
|
|
|
shift ;;
|
|
|
|
-h | --help )
|
|
|
|
echo "$DOC_STRING"
|
|
|
|
echo "$USAGE_STRING"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
* )
|
|
|
|
break ;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
#Tar.gz the stuff
|
2019-07-08 20:52:38 +08:00
|
|
|
for filepath in `find Import/ -type f -name "*.tar.gz"`; do
|
2019-01-24 22:49:22 +08:00
|
|
|
tar --keep-newer-files -xvf ${filepath}
|
2019-01-24 19:57:14 +08:00
|
|
|
done
|
2019-01-22 16:47:32 +08:00
|
|
|
|