From 4fb28506e8d2ba6c2aea827cd7722c6bf06e476d Mon Sep 17 00:00:00 2001 From: Chris Greenshields Date: Fri, 23 Nov 2018 19:16:33 +0000 Subject: [PATCH] foamGet: selecting target directory based on file name --- bin/foamGet | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/bin/foamGet b/bin/foamGet index b783ad998..0f9637d16 100755 --- a/bin/foamGet +++ b/bin/foamGet @@ -146,7 +146,7 @@ searchDirs="\ $FOAM_ETC/caseDicts" ext="ANY" -tgt="system" +tgt="" while [ "$#" -gt 0 ] do case "$1" in @@ -185,6 +185,19 @@ done [ $# -eq 1 ] || error "missing argument: no file name/prefix supplied" prefix="$1" +[ "$tgt" ] || \ + case "$prefix" in + All*) + tgt="." + ;; + *Properties|*Cloud) + tgt="constant" + ;; + *) + tgt="system" + ;; + esac + [ -s "system/controlDict" ] || \ echo "Warning: cannot find OpenFOAM case directory (no system/controlDict file)" [ -d "$tgt" ] || error "target directory does not exist: '$tgt'"