#! /bin/sh

name=`readlink -fn $0`
BD=`dirname $name`
if [ x$1 != x ]; then
    DST=$1
    ZIP=`ls $BD/../../org-lsst-ccs-localdb-*-dist.zip`
    REL=`basename $ZIP -dist.zip`
    rm -rf $DST/$REL
    unzip -o $ZIP -d $DST
else
    DST=$BD/../..
    REL=`basename \`dirname $BD\``
fi
ln -sf $REL/bin/trendingPersister.sh $DST/
ln -sf $REL/bin/trendingServer.sh $DST/
