Skip to content

Commit

Permalink
fix(cli): detect and register multiple plugins from same package (#5098)
Browse files Browse the repository at this point in the history
  • Loading branch information
sosoba authored Oct 18, 2021
1 parent 937e240 commit 25e770c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cli/src/android/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,15 @@ async function findAndroidPluginClassesInPlugin(
const entries = await Promise.all(
srcFiles.map(async (srcFile): Promise<PluginsJsonEntry | undefined> => {
const srcFileContents = await readFile(srcFile, { encoding: 'utf-8' });
classRegex.lastIndex = 0;
const classMatch = classRegex.exec(srcFileContents);

if (classMatch) {
const className = classMatch[1];

debug('Searching %O for package by %O regex', srcFile, packageRegex);

packageRegex.lastIndex = 0;
const packageMatch = packageRegex.exec(
srcFileContents.substring(0, classMatch.index),
);
Expand Down

0 comments on commit 25e770c

Please sign in to comment.