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"

echo rm -rf "$THISDIR/EquipmentLibrary_HTML"
rm -rf "$THISDIR/EquipmentLibrary_HTML"

echo ./BuildHtml "$(cygpath -aw "$THISDIR/eCat/EquipmentLibrary")" "$(cygpath -aw "$THISDIR/EquipmentLibrary_HTML")" "96" "http://download.visualcomponents.net/elib/2012/eCat/EquipmentLibrary" "http://download.visualcomponents.net/elib/2012/EquipmentLibrary_HTML" "" "1"
./BuildHtml "$(cygpath -aw "$THISDIR/eCat/EquipmentLibrary")" "$(cygpath -aw "$THISDIR/EquipmentLibrary_HTML")" "96" "http://download.visualcomponents.net/elib/2012/eCat/EquipmentLibrary" "http://download.visualcomponents.net/elib/2012/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"

mv "$THISDIR/eCat/EquipmentLibrary.zip" "$THISDIR/EquipmentLibrary.zip"
mv "$THISDIR/eCat/EquipmentLibrarymisc.zip" "$THISDIR/EquipmentLibraryMisc.zip"

rm "$THISDIR/EquipmentLibraryMisc.zip"


cp "$THISDIR/EquipmentLibrary_HTML/index.htm" "$THISDIR/EquipmentLibrary_HTML/index.html"

echo mkdir "//nfs/download/elib/2012_new"
mkdir "//nfs/download/elib/2012_new"

echo cp -r "$THISDIR/eCat" "//nfs/download/elib/2012_new"
cp -r "$THISDIR/eCat" "//nfs/download/elib/2012_new"

echo cp -r "$THISDIR/EquipmentLibrary_HTML" "//nfs/download/elib/2012_new"
cp -r "$THISDIR/EquipmentLibrary_HTML" "//nfs/download/elib/2012_new"

echo mv "//nfs/download/elib/2012" "//nfs/download/elib/2012_old"
mv "//nfs/download/elib/2012" "//nfs/download/elib/2012_old"

echo mv "//nfs/download/elib/2012_new" "//nfs/download/elib/2012"
mv "//nfs/download/elib/2012_new" "//nfs/download/elib/2012"

echo rm -rf "//nfs/download/elib/2012_old"
rm -rf "//nfs/download/elib/2012_old"

echo "DONE"