Fix handling of deeply nested charts_dir (#47)

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
This commit is contained in:
Luke Carrier
2020-10-29 18:18:17 +01:00
committed by GitHub
parent 39ca3e607f
commit ee2ad4e343
+2 -6
View File
@@ -199,12 +199,8 @@ lookup_changed_charts() {
local changed_files
changed_files=$(git diff --find-renames --name-only "$commit" -- "$charts_dir")
local fields
if [[ "$charts_dir" == '.' ]]; then
fields='1'
else
fields='1,2'
fi
local depth=$(( $(tr "/" "\n" <<< "$charts_dir" | wc -l) + 1 ))
local fields="1-${depth}"
cut -d '/' -f "$fields" <<< "$changed_files" | uniq | filter_charts
}