diff --git a/lib/shared-functions.sh b/lib/shared-functions.sh index 6ca7c21..f1dfafb 100644 --- a/lib/shared-functions.sh +++ b/lib/shared-functions.sh @@ -179,12 +179,16 @@ function check_sharelatex_env_vars() { function read_variable() { local name=$1 - grep -E "^$name=" "$TOOLKIT_ROOT/config/variables.env" \ - | sed -r "s/^$name=([\"']?)(.+)\1\$/\2/" + ( + source "$TOOLKIT_ROOT/config/variables.env" + echo "${!name:-}" + ) } function read_configuration() { local name=$1 - grep -E "^$name=" "$TOOLKIT_ROOT/config/overleaf.rc" \ - | sed -r "s/^$name=([\"']?)(.+)\1\$/\2/" + ( + source "$TOOLKIT_ROOT/config/overleaf.rc" + echo "${!name:-}" + ) }