Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
foamGet: selecting target directory based on file name
  • Loading branch information
Chris Greenshields committed Nov 23, 2018
1 parent ecd3094 commit b9f8eb8
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion bin/foamGet
Expand Up @@ -146,7 +146,7 @@ searchDirs="\
$FOAM_ETC/caseDicts"

ext="ANY"
tgt="system"
tgt=""
while [ "$#" -gt 0 ]
do
case "$1" in
Expand Down Expand Up @@ -185,6 +185,19 @@ done
[ $# -eq 1 ] || error "missing argument: no file name/prefix <file> 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'"
Expand Down

0 comments on commit b9f8eb8

Please sign in to comment.