From f2d9959bae0f2f9a2daa3ca3c4d9bd7445c01db7 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Mon, 6 Jun 2016 19:32:01 +0100 Subject: [PATCH] foamConfigurePaths: Updated foamInstall option --- bin/tools/foamConfigurePaths | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/bin/tools/foamConfigurePaths b/bin/tools/foamConfigurePaths index 41f82f277d..6d77141d90 100755 --- a/bin/tools/foamConfigurePaths +++ b/bin/tools/foamConfigurePaths @@ -79,10 +79,10 @@ _inlineSed() [ -f etc/bashrc ] || usage "Please run from top-level directory of installation" -unset foamInstall projectName projectVersion archOption +unset foamInstDir projectName projectVersion archOption unset paraviewInstall scotchArchPath -# parse options +# Parse options while [ "$#" -gt 0 ] do case "$1" in @@ -91,13 +91,18 @@ do ;; -foamInstall | --foamInstall) [ "$#" -ge 2 ] || usage "'$1' option requires an argument" - foamInstall="$2" - # replace foamInstall=... + foamInstDir="$2" + # Replace FOAM_INST_DIR=... _inlineSed \ etc/bashrc \ - 'foamInstall=.*' \ - 'foamInstall='"$foamInstall" \ - "Replacing foamInstall setting by '$foamInstall'" + '\(.*BASH_SOURCE.*\)' \ + '#\1' \ + "Removing default FOAM_INST_DIR setting" + _inlineSed \ + etc/bashrc \ + '^export FOAM_INST_DIR=.*' \ + 'export FOAM_INST_DIR='"$foamInstDir" \ + "Setting FOAM_INST_DIR to '$foamInstDir'" shift 2 ;; -projectName | --projectName) @@ -189,7 +194,7 @@ do esac done -[ -n "$foamInstall" -o -n "$projectName" -o -n "$projectVersion" -o -n "$archOption" \ +[ -n "$foamInstDir" -o -n "$projectName" -o -n "$projectVersion" -o -n "$archOption" \ -o -n "$paraviewInstall" -o -n "$paraviewVersion" \ -o -n "$scotchVersion" -o -n "$scotchArchPath" \ ] || usage "Please specify at least one configure option"