Skip to content
Snippets Groups Projects
Commit 449a0e25 authored by Mark Olesen's avatar Mark Olesen
Browse files

ENH: add -current option to foamPackBin, foamPackMake

- reduces typing
parent cf65eebc
Branches
Tags
No related merge requests found
......@@ -37,8 +37,8 @@ usage() {
cat <<USAGE 1>&2
Usage: ${0##*/} [OPTION]
options:
-o <dir> specify alternative output directory
-nogit bypass using 'git archive'
-o, -output <dir> specify alternative output directory
-nogit bypass using 'git archive'
* Pack and compress OpenFOAM directory for release
......@@ -46,7 +46,7 @@ USAGE
exit 1
}
unset prefix outputDir nogit
unset outputDir nogit
# parse options
while [ "$#" -gt 0 ]
do
......
......@@ -57,8 +57,10 @@ usage() {
while [ $# -gt 0 ]; do echo "$1" 1>&2; shift; done
cat <<USAGE 1>&2
Usage: ${0##*/} [OPTION] <archOptions>
${0##*/} [OPTION] -current
options:
-o <dir> specify alternative output directory
-c, -current use current value of \$WM_OPTIONS
-o, -output <dir> specify alternative output directory
* Pack and compress binary version of $codeBase for release
......@@ -70,7 +72,8 @@ USAGE
}
unset prefix outputDir
unset archOptions outputDir
# parse options
while [ "$#" -gt 0 ]
do
......@@ -78,6 +81,10 @@ do
-h | -help)
usage
;;
-c | -current) # use $WM_OPTIONS - eg, 'linux64GccDPOpt'
archOptions="$WM_OPTIONS"
shift
;;
-o | -output)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
outputDir=${2%%/}
......@@ -92,10 +99,14 @@ do
esac
done
[ $# -eq 1 ] || usage "Error: specify architecture"
if [ -n "$archOptions" ]
then
[ $# -eq 0 ] || usage "Error: cannot specify both -current and architecture"
else
archOptions="$1"
[ $# -eq 1 ] || usage "Error: specify architecture"
fi
# same as $WM_OPTIONS - eg, 'linux64GccDPOpt'
archOptions="$1"
#------------------------------------------------------------------------------
timeStamp=$(date +%Y-%m-%d)
......
......@@ -56,7 +56,7 @@ usage() {
cat <<USAGE 1>&2
Usage: ${0##*/} [OPTION]
options:
-o <dir> specify alternative output directory
-o, -output <dir> specify alternative output directory
* Pack and compress *.dep files from $codeBase
......@@ -123,7 +123,7 @@ find -H $packDir -name '*.dep' -type f -print | tar cpzf $packFile -T -
if [ $? -eq 0 ]
then
echo "Finished packing *.dep files into file $packFile" 1>&2
echo "Finished packing *.dep files into $packFile" 1>&2
else
echo "Error: failure packing *.dep files into $packFile" 1>&2
rm -f $packFile 2>/dev/null
......
......@@ -37,8 +37,8 @@ usage() {
cat <<USAGE 1>&2
Usage: ${0##*/} [OPTION]
options:
-prefix <dir> use alternative prefix
-o <dir> specify alternative output directory
-o, -output <dir> specify alternative output directory
-prefix <dir> use alternative prefix
* Pack and compress the OpenFOAM doxygen html for release
......@@ -54,14 +54,14 @@ do
-h | -help)
usage
;;
-prefix | --prefix)
-o | -output)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
prefix=${2%%/}
outputDir=${2%%/}
shift 2
;;
-o | -output)
-prefix | --prefix)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
outputDir=${2%%/}
prefix=${2%%/}
shift 2
;;
-*)
......@@ -120,9 +120,9 @@ fi
if [ $? -eq 0 ]
then
echo "Finished packing doxygen html into file $packFile" 1>&2
echo "Finished packing doxygen html into $packFile" 1>&2
else
echo "Error: failure packing doxygen html into file $packFile" 1>&2
echo "Error: failure packing doxygen html into $packFile" 1>&2
rm -f $packFile 2>/dev/null
fi
......
......@@ -55,8 +55,10 @@ usage() {
while [ $# -gt 0 ]; do echo "$1" 1>&2; shift; done
cat <<USAGE 1>&2
Usage: ${0##*/} [OPTION] <archOptions>
${0##*/} [OPTION] -current
options:
-o <dir> specify alternative output directory
-c, -current use current value of \$WM_OPTIONS
-o, -output <dir> specify alternative output directory
* Pack and compress $codeBase Make/<archOptions> directories
......@@ -68,7 +70,8 @@ USAGE
}
unset outputDir
unset archOptions outputDir
# parse options
while [ "$#" -gt 0 ]
do
......@@ -76,6 +79,10 @@ do
-h | -help)
usage
;;
-c | -current) # use $WM_OPTIONS - eg, 'linux64GccDPOpt'
archOptions="$WM_OPTIONS"
shift
;;
-o | -output)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
outputDir=${2%%/}
......@@ -90,10 +97,14 @@ do
esac
done
[ $# -eq 1 ] || usage "Error: specify architecture"
if [ -n "$archOptions" ]
then
[ $# -eq 0 ] || usage "Error: cannot specify both -current and architecture"
else
archOptions="$1"
[ $# -eq 1 ] || usage "Error: specify architecture"
fi
# same as $WM_OPTIONS - eg, 'linux64GccDPOpt'
archOptions="$1"
#------------------------------------------------------------------------------
timeStamp=$(date +%Y-%m-%d)
......
......@@ -84,9 +84,9 @@ trap 'rm -f $packFile $tmpFile 2>/dev/null' INT
tar cpzf $packFile --files-from $tmpFile
if [ $? -eq 0 ]
then
echo "Finished packing $packDir into file $packFile" 1>&2
echo "Finished packing $packDir into $packFile" 1>&2
else
echo "Error: failure packing $packDir into file $packFile" 1>&2
echo "Error: failure packing $packDir into $packFile" 1>&2
rm -f $packFile 2>/dev/null
fi
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment