Skip to content

Conversation

aabouzaid
Copy link

A tiny fix to make charts_dir works again with the current working dir.
Related to: #61

Signed-off-by: Ahmed AbouZaid <ahmed.abouzaid@camunda.com>
@aabouzaid aabouzaid force-pushed the fix-charts-dir-depth branch from 9465696 to 1d2f81d Compare November 8, 2020 23:36
@cpanato cpanato requested a review from unguiculus February 18, 2021 09:15
Copy link
Member

@unguiculus unguiculus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this might fix it for the root dir, it breaks it if charts are in the default charts dir.

@@ -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" | wc -l) ))
Copy link

@monotek monotek Mar 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should do the drick:

Suggested change
local depth=$(( $(tr "/" "\n" <<< "$charts_dir" | wc -l) ))
local depth=$(( $(tr "/" "\n" <<< "$charts_dir" | sed '/^\(\.\)*$/d' | wc -l) + 1 ))

sed deletes empty lines which should fix the absolute path problem and deletes lines which only contain a ".".

@monotek
Copy link

monotek commented Mar 7, 2021

@aabouzaid
could you update your pr please?

@unguiculus
Copy link
Member

Superseded by #83

@unguiculus unguiculus closed this Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants