#!/bin/sh

PUB_TARGET="$1"
PUB_BUILD="$2"
PUB_SOURCE="$3"

MIMETYPES="()"
EXPORTER="skypubexport"

if ! test -d "$PUB_TARGET"; then
  echo "$0: target directory $PUB_TARGET does not exist or is not a directory!"
  exit 1
fi
if ! test -d $PUB_BUILD; then
  echo "$0: build directory $PUB_BIILD  does not exist or is not a directory!"
  exit 2
fi

cd $PUB_BUILD

echo "export: "
echo "  build:  $PUB_BUILD ($PWD)"
echo "  target: $PUB_TARGET"
echo "  source: $PUB_SOURCE"

nice -n 19 $EXPORTER -login local -project . \
	-source $PUB_SOURCE	\
	-target $PUB_TARGET	\
	-LSMimeTypes "$MIMETYPES"
