#!/bin/tcsh
#
# ug_dart_copy_html
#
# purpose: update the directories ".../public_html/.../Dashboard" and
#          ".../public_html/.../Sites" that the web server may display
#          the latest test results

set TEST = ${DART_HOME}/Source/Server/UG/Testing/HTML/TestingResults/;
set TEST_BOARD = ${TEST}/Dashboard;
set TEST_SITES = ${TEST}/Sites;
set WEB = ${HOME}/public_html/;
set INCOMING = ${HOME}/incoming;

# update the directories in WEB
cp -r -u -f  ${TEST} ${WEB};

# remove not needed directories in TEST
cd ${TEST_BOARD};
foreach i ( `ls -l ./` )
	if { test -d ${i} } then
		rm -r ${i};
	else if { test -f ${i} } then
		rm ${i};
	endif
end

cd ${TEST_SITES};
foreach i ( `ls -l ./` )
	if { test -d ${i} } then
		rm -r ${i};
	else if { test -f ${i} } then
		rm ${i};
	endif
end

cd ${INCOMING};
foreach i ( `ls -l ./` )
	if { test -d ${i} } then
		rm -r ${i};
	else if { test -f ${i} } then
		rm ${i};
	endif
end

# delete outdated Dahsboards in WEB
ug_dart_manage_html.pl

