Skip to content
Snippets Groups Projects
Commit 0ad40e7f authored by Anders Lindh Olsson's avatar Anders Lindh Olsson :8ball:
Browse files

removed usage of env.sh and replaced with checks for IOCNAME being set

parent 183546a3
No related branches found
No related tags found
No related merge requests found
...@@ -13,12 +13,13 @@ core.* ...@@ -13,12 +13,13 @@ core.*
.#* .#*
\#* \#*
*.local *.local
e3.cfg
tools/ess-env.conf
.vscode .vscode
cellMods
*.log
__pycache__
require-ess/require.Makefile require-ess/require.Makefile
require-ess/Db/*.db require-ess/Db/*.db
require-ess/Db/*.d require-ess/Db/*.d
cellMods e3.cfg
*.log tools/ess-env.conf
__pycache__
\ No newline at end of file
...@@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ...@@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Other changes ### Other changes
* removed legacy code from setE3Env.bash * removed legacy code from setE3Env.bash
* Removed usage of `env.sh` - now there is a check only for seeing if the environment variable `$IOCNAME` is set
## [3.4.1] ## [3.4.1]
......
...@@ -58,9 +58,6 @@ declare BASECODE="" ...@@ -58,9 +58,6 @@ declare BASECODE=""
# To get the absolute path where iocsh.bash is executed # To get the absolute path where iocsh.bash is executed
IOCSH_TOP=${PWD} IOCSH_TOP=${PWD}
# Load any environment variables, default is $IOCSH_TOP/env.sh
loadEnv "$@"
# Check whether an expected e3 environment variable is defined. # Check whether an expected e3 environment variable is defined.
# #
if [[ -z "${EPICS_DRIVER_PATH}" ]]; then if [[ -z "${EPICS_DRIVER_PATH}" ]]; then
......
...@@ -267,30 +267,11 @@ function check_mandatory_env_settings() { ...@@ -267,30 +267,11 @@ function check_mandatory_env_settings() {
die 1 " $var is not defined!. Please source ${E3_REQUIRE_BIN}/setE3Env.bash " die 1 " $var is not defined!. Please source ${E3_REQUIRE_BIN}/setE3Env.bash "
fi fi
done done
}
function loadEnv() {
local envfile=$IOCSH_TOP/env.sh
local warn=false
while [ $# -gt 0 ]; do
arg=$1 if [[ -z "$IOCNAME" ]]; then
case $arg in echo "Warning: environment variable IOCNAME is not set." >&2
-e) else
shift echo "IOCNAME is set to $IOCNAME"
envfile=$1
warn=true
;;
esac
shift
done
if [ -f "$envfile" ]; then
echo "Loading environment variables from $envfile"
# shellcheck disable=SC1090
source "$envfile"
elif [ "$warn" = true ]; then
echo "Warning: environment file $envfile does not exist." >&2
fi fi
} }
...@@ -351,9 +332,6 @@ function loadFiles() { ...@@ -351,9 +332,6 @@ function loadFiles() {
shift shift
__LOADER__="valgrind --leak-check=full " __LOADER__="valgrind --leak-check=full "
;; ;;
-e)
shift
;;
-n) -n)
__LOADER__="nice --10 " __LOADER__="nice --10 "
shift shift
...@@ -435,7 +413,6 @@ function help() { ...@@ -435,7 +413,6 @@ function help() {
printf "Options:\n\n" printf "Options:\n\n"
printf " -?, -h, --help Show this page and exit.\n" printf " -?, -h, --help Show this page and exit.\n"
printf " -v, --version Show version and exit.\n" printf " -v, --version Show version and exit.\n"
printf " -e 'env_file' Load a given environment file 'env_file'.\n"
printf " -c 'cmd args' Ioc shell command.\n" printf " -c 'cmd args' Ioc shell command.\n"
printf " -l 'cell path' Run Ioc with a cell path.\n" printf " -l 'cell path' Run Ioc with a cell path.\n"
printf " -s 'prog m=v' Sequencer program (and arguments), run with 'seq'.\n" printf " -s 'prog m=v' Sequencer program (and arguments), run with 'seq'.\n"
......
IOCSH_HASH_VERSION=d3c308e IOCSH_HASH_VERSION=d7ee603
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