From 1eca13aeb9a363f7b78583f9bec664edadf71703 Mon Sep 17 00:00:00 2001
From: Henry Weller <http://cfd.direct>
Date: Sat, 9 Jan 2016 23:09:08 +0000
Subject: [PATCH] CleanFunctions: Check the constant directory exists before
 cleaning it

---
 bin/tools/CleanFunctions | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/bin/tools/CleanFunctions b/bin/tools/CleanFunctions
index b17efcfbb58..d58feb9f7a3 100644
--- a/bin/tools/CleanFunctions
+++ b/bin/tools/CleanFunctions
@@ -2,7 +2,7 @@
 # =========                 |
 # \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
 #  \\    /   O peration     |
-#   \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+#   \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
 #    \\/     M anipulation  |
 #------------------------------------------------------------------------------
 # License
@@ -94,11 +94,14 @@ cleanCase()
             > /dev/null 2>&1 \
         )
     fi
-    (cd constant && \
-        rm -rf \
-        cellToRegion cellLevel* pointLevel* \
-        > /dev/null 2>&1 \
-    )
+    if [ -d constant ]
+    then
+        (cd constant && \
+            rm -rf \
+            cellToRegion cellLevel* pointLevel* \
+            > /dev/null 2>&1 \
+        )
+    fi
 
     rm -rf constant/tetDualMesh > /dev/null 2>&1
 
-- 
GitLab