tstamp="$1"
BDIR="$2"
ADDED="$3"
REMOVED="$4"

TOOLDIR="$(cygpath "$BDIR")depot/Equipment Library/Tools"
THISDIR=$(pwd)

cd "$TOOLDIR"

echo "Here: $THISDIR"
echo "Tool: $TOOLDIR"

rm -rf "$THISDIR/EquipmentLibrary_HTML"

echo ./BuildHtml "$(cygpath -aw "$THISDIR/eCat/EquipmentLibrary")" "$(cygpath -aw "$THISDIR/EquipmentLibrary_HTML")" "96" "http://download.visualcomponents.net/elib/KUKA_Sim_2.2/eCat/EquipmentLibrary" "http://download.visualcomponents.net/elib/KUKA_Sim_2.2/EquipmentLibrary_HTML" "" "1"
./BuildHtml "$(cygpath -aw "$THISDIR/eCat/EquipmentLibrary")" "$(cygpath -aw "$THISDIR/EquipmentLibrary_HTML")" "96" "http://download.visualcomponents.net/elib/KUKA_Sim_2.2/eCat/EquipmentLibrary" "http://download.visualcomponents.net/elib/KUKA_Sim_2.2/EquipmentLibrary_HTML" "" "1"

VERSION=$(cat version.txt)

DTHISDIR="$(cygpath -aw "$THISDIR/eCat/EquipmentLibrary"|sed 's/\\/\\\\/g')"

echo "Dos path: $DTHISDIR"

chmod -R 755 "$THISDIR/eCat"
chmod -R 755 "$THISDIR/EquipmentLibrary_HTML"
chmod -R 755 "$THISDIR/Disclaimer"


mv "$THISDIR/eCat/EquipmentLibrary.zip" "$THISDIR/EquipmentLibrary.zip"
mv "$THISDIR/eCat/EquipmentLibrarymisc.zip" "$THISDIR/EquipmentLibraryMisc.zip"
cp "$THISDIR/equipmentLibrary_HTML/ecat.map" "$THISDIR/Disclaimer/ecat.map"
cp "$THISDIR/equipmentLibrary_HTML/components.xml" "$THISDIR/Disclaimer/components.xml"

mkdir "//nfs/download/elib/KUKA_Sim_2.2_new"

cp -r "$THISDIR/eCat" "//nfs/download/elib/KUKA_Sim_2.2_new"
cp -r "$THISDIR/EquipmentLibrary_HTML" "//nfs/download/elib/KUKA_Sim_2.2_new"
cp -r "$THISDIR/Disclaimer" "//nfs/download/elib/KUKA_Sim_2.2_new"

mv "//nfs/download/elib/KUKA_Sim_2.2" "//nfs/download/elib/KUKA_Sim_2.2_old"
mv "//nfs/download/elib/KUKA_Sim_2.2_new" "//nfs/download/elib/KUKA_Sim_2.2"

rm -rf "//nfs/download/elib/KUKA_Sim_2.2_old"