Remove config wrappers.
This commit is contained in:
@@ -62,16 +62,18 @@ CONFIG_FILE="${WC_HOME}/config.yaml"
|
||||
|
||||
if [ ! -f "${CONFIG_FILE}" ]; then
|
||||
echo "Error: config file not found at ${CONFIG_FILE}" >&2
|
||||
exit 1
|
||||
echo ""
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Use yq to extract the value from the YAML file
|
||||
result=$(yq eval ".${KEY_PATH}" "${CONFIG_FILE}") 2>/dev/null
|
||||
result=$(yq eval ".${KEY_PATH}" "${CONFIG_FILE}" 2>/dev/null || echo "null")
|
||||
|
||||
# Check if result is null (key not found)
|
||||
if [ "${result}" = "null" ]; then
|
||||
echo "Error: Key path '${KEY_PATH}' not found in ${CONFIG_FILE}" >&2
|
||||
exit 1
|
||||
echo ""
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "${result}"
|
Reference in New Issue
Block a user