mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
foamAllHC / foamEbrowse / foamNew - error checking
This commit is contained in:
@ -30,6 +30,9 @@
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
find . -name "*.[HCL]" -exec $1 {} \; -print
|
||||
if [ "$#" -gt 0 ]
|
||||
then
|
||||
find . -name "*.[HCL]" -exec $1 {} \; -print
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -41,12 +41,12 @@ if [ $# -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Clean up on termination and on Ctrl-C
|
||||
trap 'rm -f $headersFile $sourcesFile 2>/dev/null; exit 0' EXIT TERM INT
|
||||
|
||||
cd $WM_PROJECT_DIR
|
||||
find -H . -name "*.H" | fgrep -v "lnInclude" > $headersFile
|
||||
find -H . -name "*.C" | fgrep -v "lnInclude" > $sourcesFile
|
||||
ebrowse --files=$headersFile --files=$sourcesFile --output-file=.ebrowse
|
||||
|
||||
# Clean up on termination and on Ctrl-C
|
||||
trap 'rm -f $headersFile $sourcesFile 2>/dev/null; exit 0' EXIT TERM INT
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
22
bin/foamNew
22
bin/foamNew
@ -46,19 +46,23 @@ USAGE
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [ "$#" -lt 1 ]; then
|
||||
if [ "$#" -lt 2 ]
|
||||
then
|
||||
usage "wrong number of arguments, expected 2 (or more)"
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
source)
|
||||
shift
|
||||
$WM_PROJECT_DIR/bin/foamTemplates/source/newSource $*
|
||||
;;
|
||||
template)
|
||||
shift
|
||||
$WM_PROJECT_DIR/bin/foamTemplates/sourceTemplate/newSourceTemplate $*
|
||||
;;
|
||||
-h | -help)
|
||||
usage
|
||||
;;
|
||||
source)
|
||||
shift
|
||||
$WM_PROJECT_DIR/bin/foamTemplates/source/newSource $*
|
||||
;;
|
||||
template)
|
||||
shift
|
||||
$WM_PROJECT_DIR/bin/foamTemplates/sourceTemplate/newSourceTemplate $*
|
||||
;;
|
||||
*)
|
||||
usage "unknown type"
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user