WIP
fix #716
Simple implementation where in replace_os_vars fun I handle the case where the env var is not set and I replace the var with a marker named RELX_REPLACE_VAR_NOT_SET.
Then before running the vm, I check if the marker is set in vm.args and sys.config.
I that is the case, I stop the execution and print an error.
As an example, if I have in my vm.args.src:
and APP_CONFIG_FILE is not set the error returned is
Error: an ENV variable in sys.config is not set:
{config_file_name, "RELX_REPLACE_VAR_NOT_SET: {$APP_CONFIG_FILE}"}
This also fix the previous implementation where I check with slen > 1 && e=="" if the env var is set.
This is not correct since an ENV var could be set to an empty string. The right way is to use builtin v in ENVIRON
Let me know what if you think.
WIP fix #716 Simple implementation where in
replace_os_vars
fun I handle the case where the env var is not set and I replace the var with a marker namedRELX_REPLACE_VAR_NOT_SET
. Then before running the vm, I check if the marker is set in vm.args and sys.config. I that is the case, I stop the execution and print an error. As an example, if I have in myvm.args.src
:and VM_START_EPMD is not set the error returned is
If I have in my
sys.config.src
and APP_CONFIG_FILE is not set the error returned is
This also fix the previous implementation where I check with
slen > 1 && e==""
if the env var is set. This is not correct since an ENV var could be set to an empty string. The right way is to use builtinv in ENVIRON
Let me know what if you think.