Skip to content

Commit

Permalink
fix override when the original and the override have overlapping subs…
Browse files Browse the repository at this point in the history
…trings
  • Loading branch information
ElenaDiachenko committed Nov 18, 2024
1 parent 3a02834 commit 15cce6c
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 15cce6c

Please sign in to comment.