1
0
Fork 0
mirror of https://github.com/overleaf/toolkit.git synced 2025-04-19 07:18:06 +02:00

use a simpler solution of source coupled with echo in a bash subshell

This commit is contained in:
Kevin Manuel 2024-10-01 13:11:23 +01:00
parent a1bb74c998
commit 5c1bde66ba

View file

@ -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=([\"']?)([^\"']+)[\"']?$/\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=([\"']?)([^\"']+)[\"']?$/\2/"
(
source "$TOOLKIT_ROOT/config/overleaf.rc"
echo "${!name:-}"
)
}