Skip to content

Commit

Permalink
Slightly improve sed-based yaml parsing (#4721)
Browse files Browse the repository at this point in the history
Previous sed did not handle the valid `profile: foo`
  • Loading branch information
bkrausz committed Jul 13, 2021
1 parent 27ec657 commit 7decb12
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7decb12

Please sign in to comment.