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:
parent
a1bb74c998
commit
5c1bde66ba
1 changed files with 8 additions and 4 deletions
|
@ -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:-}"
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue