quickfix; trim timezone
This commit is contained in:
parent
7261ffe8a2
commit
60635feeab
@ -588,6 +588,12 @@ load_vars_file() {
|
||||
[[ "$var_key" != var_* ]] && continue
|
||||
_is_whitelisted "$var_key" || continue
|
||||
|
||||
# Strip inline comments (anything after unquoted #)
|
||||
# Only strip if not inside quotes
|
||||
if [[ ! "$var_val" =~ ^[\"\'] ]]; then
|
||||
var_val="${var_val%%#*}"
|
||||
fi
|
||||
|
||||
# Strip quotes
|
||||
if [[ "$var_val" =~ ^\"(.*)\"$ ]]; then
|
||||
var_val="${BASH_REMATCH[1]}"
|
||||
@ -595,6 +601,9 @@ load_vars_file() {
|
||||
var_val="${BASH_REMATCH[1]}"
|
||||
fi
|
||||
|
||||
# Trim trailing whitespace
|
||||
var_val="${var_val%"${var_val##*[![:space:]]}"}"
|
||||
|
||||
# Set variable: force mode overrides existing, otherwise only set if empty
|
||||
if [[ "$force" == "yes" ]]; then
|
||||
export "${var_key}=${var_val}"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user