TUT: clean out old tutorial build directories

This commit is contained in:
Mark Olesen 2018-03-26 15:54:31 +02:00
parent 36719bf55b
commit db76bbbac0
2 changed files with 20 additions and 16 deletions

View File

@ -3,6 +3,15 @@ cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/LogFunctions # Tutorial log-file functions
echo "--------"
# Remove old build/ directory
buildDir="$WM_PROJECT_DIR/build/${WM_OPTIONS}/${PWD##*/}"
if [ -d "$buildDir" ]
then
echo "Removing old build directory: $buildDir" 1>&2
rm -rf $buildDir
fi
removeLogs
echo "Cleaning tutorials ..."

View File

@ -7,20 +7,8 @@
# \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
# This file is part of OpenFOAM, licensed under GNU General Public License
# <http://www.gnu.org/licenses/>.
#
# Script
# Alltest
@ -101,9 +89,8 @@ done
#------------------------------------------------------------------------------
#
# set up a default scheme on all schemes
# Set up a default scheme on all schemes
#
setDefaultFvSchemes()
{
@ -180,6 +167,14 @@ then
rm -rf $TEST_RUN_DIR
fi
# Remove old build/ directory
buildDir="$WM_PROJECT_DIR/build/${WM_OPTIONS}/${TEST_RUN_DIR##*/}"
if [ -d "$buildDir" ]
then
echo "Removing old build directory: $buildDir" 1>&2
rm -rf $buildDir
fi
echo "Modifying ${MAIN_CONTROL_DICT}" 1>&2
if [ -e ${MAIN_CONTROL_DICT}.orig ]
then