Skip to content

Commit

Permalink
Fix handling of deeply nested charts_dir
Browse files Browse the repository at this point in the history
Fixes #46
  • Loading branch information
LukeCarrier committed Oct 16, 2020
1 parent 06d81fa commit f9ba776
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions cr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit f9ba776

Please sign in to comment.