From c1df207ae7bb7cf144b4a78adc1f72367b1e9246 Mon Sep 17 00:00:00 2001 From: "sebastien.heurtematte" Date: Thu, 27 Jul 2023 15:36:09 +0200 Subject: [PATCH] feat: add comment in cbi config file Signed-off-by: sebastien.heurtematte --- utils/local_config.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/local_config.sh b/utils/local_config.sh index 1ff5070..faaae79 100755 --- a/utils/local_config.sh +++ b/utils/local_config.sh @@ -80,10 +80,10 @@ get_var() { fi if [[ -z "${group}" ]] || [[ "${group}" == "" ]]; then - lcv="$(jq -r ".\"${name}\"" "${LOCAL_CONFIG}")" + lcv="$(sed -re 's#^(([^"\n]*"[^"\n]*")*[^"\n]*)\/\/.*$#\1#' -e '/^[[:blank:]]*#/d' "${LOCAL_CONFIG}"| jq -r ".\"${name}\"")" _check_if_var_exists "${lcv}" "${name}" else - lcv="$(jq -r ".[\"${group}\"][\"${name}\"]" "${LOCAL_CONFIG}")" + lcv="$(sed -re 's#^(([^"\n]*"[^"\n]*")*[^"\n]*)\/\/.*$#\1#' -e '/^[[:blank:]]*#/d' "${LOCAL_CONFIG}"| jq -r ".[\"${group}\"][\"${name}\"]")" _check_if_var_exists "${lcv}" "${group}/${name}" fi echo "${lcv}"