From 702702f86c5e8789af236de3999e77530714bd82 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Wed, 16 Jun 2021 08:49:55 -0400 Subject: [PATCH] Fixes an issue with chart_depth when charts_dir is . (#83) Signed-off-by: chrisbsmith --- cr.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cr.sh b/cr.sh index bd0a584..2ad0d75 100755 --- a/cr.sh +++ b/cr.sh @@ -225,7 +225,7 @@ 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 depth=$(( $(tr "/" "\n" <<< "$charts_dir" | sed '/^\(\.\)*$/d' | wc -l) + 1 )) local fields="1-${depth}" cut -d '/' -f "$fields" <<< "$changed_files" | uniq | filter_charts