# HG changeset patch # User Severin Gehwolf # Date 1503929633 -7200 # Node ID c2b62c4b9110a8e828117bb2bc9123167b995f94 # Parent 2135485b81c7942401382fb49b10a4e6659c2377 Erase pre-existing web-client dir in WEB_GATEWAY_ROOT. Reviewed-by: almac Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2017-August/024707.html diff -r 2135485b81c7 -r c2b62c4b9110 thermostat-ng.sh --- a/thermostat-ng.sh Mon Aug 28 08:20:07 2017 -0400 +++ b/thermostat-ng.sh Mon Aug 28 16:13:53 2017 +0200 @@ -349,8 +349,15 @@ # deploy web-client resources statically, more info at http://icedtea.classpath.org/pipermail/thermostat/2017-May/023164.html copy_web_client_to_web_gateway() { - local dist_dir="${WEB_CLIENT_ROOT}/dist"; + local dist_dir="${WEB_CLIENT_ROOT}/dist" + local web_client_deploy_dir="$WEB_GATEWAY_ROOT/distribution/target/image/web-client" if [ -d "$dist_dir" ]; then + # Be sure to erase pre-existing web-client dir in WEB_GATEWAY_ROOT so as to not + # copy web-client to $WEB_GATEWAY_ROOT/distribution/target/image/web-client/dist + # instead of the expected $WEB_GATEWAY_ROOT/distribution/target/image/web-client + if [ -d "$web_client_deploy_dir" ]; then + rm -rf "$web_client_deploy_dir" + fi cp -r $dist_dir $WEB_GATEWAY_ROOT/distribution/target/image/web-client; echo "Web client copied to web-gateway." else