From 7decb12818ad2cc0c7b3039c3d5e620236250edd Mon Sep 17 00:00:00 2001 From: Brian Krausz Date: Tue, 13 Jul 2021 09:34:14 -0700 Subject: [PATCH] Slightly improve sed-based yaml parsing (#4721) Previous sed did not handle the valid `profile: foo` --- .../src/main/resources/dbt_transformation_entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airbyte-workers/src/main/resources/dbt_transformation_entrypoint.sh b/airbyte-workers/src/main/resources/dbt_transformation_entrypoint.sh index 8e9a3119176c2..3723834c668d9 100644 --- a/airbyte-workers/src/main/resources/dbt_transformation_entrypoint.sh +++ b/airbyte-workers/src/main/resources/dbt_transformation_entrypoint.sh @@ -4,7 +4,7 @@ set -e CWD=$(pwd) if [[ -f "${CWD}/git_repo/dbt_project.yml" ]]; then # Find profile name used in the custom dbt project: - PROFILE_NAME=$(grep -e "profile:" < "${CWD}/git_repo/dbt_project.yml" | sed -E "s/profile: *['\"](.*)['\"]/\1/") + PROFILE_NAME=$(grep -e "profile:" < "${CWD}/git_repo/dbt_project.yml" | sed -E "s/profile: *['\"]?([^'\"]*)['\"]?/\1/") if [[ -n "${PROFILE_NAME}" ]]; then mv "${CWD}/profiles.yml" "${CWD}/profiles.txt" # Refer to the appropriate profile name in the profiles.yml file