#!/bin/bash

if [ "x$GSDL3HOME" = "x" ] ; then
    echo ""
    GSDL3HOME=../../../web
    echo "Using relative diretory for GSDL3HOME:"
    echo "  $GSDL3HOME"
    echo ""
fi

if [ ! -d "$GSDL3HOME/ext/structured-image/" ] ; then
    echo ""
    echo "Creating directory:"
    echo "    $GSDL3HOME/ext/structured-image"
    echo ""
    mkdir "$GSDL3HOME/ext/structured-image"
fi
    
if [ -d "$GSDL3HOME/ext/structured-image/mirador3" ] ; then
    echo ""
    echo "Removing previous installation:"
    echo "    $GSDL3HOME/ext/structured-image/mirador3"

    /bin/rm -rf "$GSDL3HOME/ext/structured-image/mirador3"
fi

echo ""
echo "Installing webpack JS library for gs-annotations to:"
echo "    $GSDL3HOME/ext/structured-image/mirador3"

mkdir "$GSDL3HOME/ext/structured-image/mirador3"

/bin/cp -r mirador-integration-annotations-gitfork/webpack/dist-gs-annotations "$GSDL3HOME/ext/structured-image/mirador3/dist"

echo ""



