ENH: have wmake and wclean do something sensible with a filename as target

- For convenience, let "wmake some/path/filename.C"
  behave similar to    "wmake some/path"
  and trace back for the Make directory.
This commit is contained in:
Mark Olesen
2017-02-10 10:33:50 +01:00
committed by mark
parent c1795a30b8
commit 6343e1e3b3
2 changed files with 10 additions and 3 deletions

View File

@ -100,10 +100,13 @@ MakeDir=Make
if [ $# -ge 1 ]
then
if [ -d "$1" ]
then
dir=$1
elif [ -f "$1" ]
then
dir="${1%/*}"
: ${dir:=.}
else
targetType=$1
fi

View File

@ -4,7 +4,7 @@
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation |
# \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
#-------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
@ -250,7 +250,11 @@ if [ $# -ge 1 ]
then
if [ -d "$1" ]
then
dir=$1
dir="$1"
elif [ -f "$1" ]
then
dir="${1%/*}"
: ${dir:=.}
else
targetType=$1
fi