From 10505f45121c008e50939cc65e394587ae879143 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reinhard=20N=C3=A4gele?= Date: Fri, 30 Oct 2020 19:13:34 +0100 Subject: [PATCH] Revert "Fix handling of deeply nested charts_dir (#47)" This reverts commit ee2ad4e3431eef2acb2c9e0a91c1a5eb24f00d88. --- cr.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cr.sh b/cr.sh index 23efb3b..434c67f 100755 --- a/cr.sh +++ b/cr.sh @@ -210,8 +210,12 @@ lookup_changed_charts() { local changed_files changed_files=$(git diff --find-renames --name-only "$commit" -- "$charts_dir") - local depth=$(( $(tr "/" "\n" <<< "$charts_dir" | wc -l) + 1 )) - local fields="1-${depth}" + local fields + if [[ "$charts_dir" == '.' ]]; then + fields='1' + else + fields='1,2' + fi cut -d '/' -f "$fields" <<< "$changed_files" | uniq | filter_charts }