Skip to content

Commit 9b4fba4

Browse files
authoredAug 16, 2023
Reduce verbosity in openfoam-remove-empty-dirs.sh (precice#368)
1 parent 1a1f2d5 commit 9b4fba4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
 

‎tools/openfoam-remove-empty-dirs.sh

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
#! /bin/sh
22

3+
# Cleaning up stray functionObjectProperties files, see https://github.com/precice/openfoam-adapter/issues/26
34
openfoam_remove_empty_dirs() {
45
(
56
set -e -u
6-
echo "Looking for any time directories without results (e.g. stray functionObjectProperties files, see openfoam-adapter issue #26 on GitHub)..."
7+
echo "Cleaning up any time directories without results"
78

89
for f in [0-9]* [0-9]*.[0-9]*; do
910
if ! [ -f "${f}/U" ] && ! [ -f "${f}/T" ] && ! [ -f "${f}/U.gz" ] && ! [ -f "${f}/T.gz" ] && ! [ -f "${f}/D" ] && ! [ -f "${f}/pointD" ] && ! [ -f "${f}/DD" ] && ! [ -f "${f}/pointDD" ] && ! [ -f "${f}/D.gz" ] && ! [ -f "${f}/pointD.gz" ] && ! [ -f "${f}/DD.gz" ] && ! [ -f "${f}/pointDD.gz" ]; then
10-
rm -rfv "${f}"
11+
rm -rf "${f}"
1112
fi
1213
done
1314
if [ -d processor0 ]; then
1415
for d in processor*; do
1516
cd "${d}"
1617
for f in [0-9]* [0-9]*.[0-9]*; do
1718
if ! [ -f "${f}/U" ] && ! [ -f "${f}/T" ] && ! [ -f "${f}/U.gz" ] && ! [ -f "${f}/T.gz" ] && ! [ -f "${f}/D" ] && ! [ -f "${f}/pointD" ] && ! [ -f "${f}/DD" ] && ! [ -f "${f}/pointDD" ] && ! [ -f "${f}/D.gz" ] && ! [ -f "${f}/pointD.gz" ] && ! [ -f "${f}/DD.gz" ] && ! [ -f "${f}/pointDD.gz" ]; then
18-
rm -rfv "${f}"
19+
rm -rf "${f}"
1920
fi
2021
done
2122
cd ..
2223
done
2324
fi
25+
echo "Done."
2426
)
2527
}

0 commit comments

Comments
 (0)
Please sign in to comment.