Skip to content

Commit

Permalink
Merge pull request #1790 from flexn-io/chore/cherry-pick_fix_override
Browse files Browse the repository at this point in the history
fix override when the original and the override have overlapping subs…
  • Loading branch information
pauliusguzas authored Nov 19, 2024
2 parents 0b83364 + dd32f4b commit d666c3c
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions packages/core/src/plugins/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -830,9 +830,26 @@ export const overrideFileContents = (
)}. FIXING...DONE`
);
} else if (overrideExists) {
logInfo(
`${chalk().gray(dest)} overridden by: ${chalk().gray(overridePath.split('node_modules').pop())}`
);
if (originalExists) {
if (fk.includes(override[fk])) {
fileToFix = fileToFix.replace(originalRegEx, `${override[fk]}`);
logSuccess(
`${chalk().bold.white(dest)} requires override by: ${chalk().bold.white(
overridePath.split('node_modules').pop()
)}. FIXING...DONE`
);
} else {
logInfo(
`${chalk().gray(dest)} overridden by: ${chalk().gray(
overridePath.split('node_modules').pop()
)}`
);
}
} else {
logInfo(
`${chalk().gray(dest)} overridden by: ${chalk().gray(overridePath.split('node_modules').pop())}`
);
}
} else {
failTerms.push(fk);
}
Expand Down

0 comments on commit d666c3c

Please sign in to comment.