Skip to content
Snippets Groups Projects
Commit 1c10e982 authored by Simon Rose's avatar Simon Rose
Browse files

Added flag to iocsh.bash to choose env.sh file

parent 1d4f489b
No related branches found
No related tags found
No related merge requests found
......@@ -58,12 +58,8 @@ declare -r TMP_PATH="/tmp/systemd-private-e3-iocsh-$(whoami)"
# To get the absolute path where iocsh.bash is executed
IOCSH_TOP=${PWD}
# Load any environment variables
if [ -f "$IOCSH_TOP/env.sh" ]; then
echo "Loading environment variables from $IOCSH_TOP/env.sh"
source "$IOCSH_TOP/env.sh"
fi
# Load any environment variables, default is $IOCSH_TOP/env.sh
loadEnv "$@"
BASECODE="$(basecode_generator)"
......
......@@ -374,7 +374,26 @@ function check_mandatory_env_settings
done
};
function loadEnv
{
local envfile=$IOCSH_TOP/env.sh
while [ $# -gt 0 ]; do
arg=$1
case $arg in
( -e )
shift
envfile=$1
;;
esac
shift
done
if [ -f "$envfile" ]; then
echo "Loading environment variables from $envfile"
source "$envfile"
fi
}
function loadFiles
{
......@@ -438,6 +457,9 @@ function loadFiles
( -dv )
shift
__LOADER__="valgrind --leak-check=full "
;;
( -e )
shift
;;
( -* )
printf "Unknown option $1\n\n" >&2
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment