Skip to content

Commit 799fbd1

Browse files
Merge pull request #129 from waynetheisinger/weirdnewline
fix(automodman): Weird new line breaking things on High Sierra
2 parents 318a588 + 23a634a commit 799fbd1

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

modman

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -656,12 +656,20 @@ run_automodman () #"$module" "$mm" "$wc_dir" "$wc_desc"
656656
#first f tends to be empty because of our stripping the path down so test for it -n is default operator
657657
if [ "$pathname" ]; then
658658
659-
# find a previous match for the path. if there is one the exitcode will be 1, otherwise 0.
660-
prevmatch=$(! printf -- '%s\n' "${ARRAY[@]}" | grep -qv "${pathname/$incPath/}"; echo $?)
661-
659+
prevmatch=0
660+
661+
if [[ ${incpaths[@]} ]]; then
662+
for i in "${incpaths[@]}"
663+
do
664+
if [[ "$pathname" =~ "$i" ]] ; then
665+
prevmatch=1
666+
fi
667+
done
668+
fi
669+
662670
#if substring then do recurse
663-
if [[ $prevmatch -eq 0 ]]; then #make sure we have not previously matched
664-
671+
if [[ $prevmatch -eq 0 ]]; then #make sure we have not previously matched to prevent subpaths
672+
665673
#pre-existing path: yes | no?
666674
if grep -rq "^[^#].*\s$pathname$" "${amm}/"*"/modman" #target is what is important so find end line not beginning line
667675
then #pre-existing path: yes

0 commit comments

Comments
 (0)