mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
foamGet: selecting target directory based on file name
This commit is contained in:
15
bin/foamGet
15
bin/foamGet
@ -146,7 +146,7 @@ searchDirs="\
|
|||||||
$FOAM_ETC/caseDicts"
|
$FOAM_ETC/caseDicts"
|
||||||
|
|
||||||
ext="ANY"
|
ext="ANY"
|
||||||
tgt="system"
|
tgt=""
|
||||||
while [ "$#" -gt 0 ]
|
while [ "$#" -gt 0 ]
|
||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@ -185,6 +185,19 @@ done
|
|||||||
[ $# -eq 1 ] || error "missing argument: no file name/prefix <file> supplied"
|
[ $# -eq 1 ] || error "missing argument: no file name/prefix <file> supplied"
|
||||||
prefix="$1"
|
prefix="$1"
|
||||||
|
|
||||||
|
[ "$tgt" ] || \
|
||||||
|
case "$prefix" in
|
||||||
|
All*)
|
||||||
|
tgt="."
|
||||||
|
;;
|
||||||
|
*Properties|*Cloud)
|
||||||
|
tgt="constant"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
tgt="system"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
[ -s "system/controlDict" ] || \
|
[ -s "system/controlDict" ] || \
|
||||||
echo "Warning: cannot find OpenFOAM case directory (no system/controlDict file)"
|
echo "Warning: cannot find OpenFOAM case directory (no system/controlDict file)"
|
||||||
[ -d "$tgt" ] || error "target directory does not exist: '$tgt'"
|
[ -d "$tgt" ] || error "target directory does not exist: '$tgt'"
|
||||||
|
|||||||
Reference in New Issue
Block a user