Skip to content

Commit

Permalink
Minor regex fix
Browse files Browse the repository at this point in the history
  • Loading branch information
barthap committed Dec 15, 2021
1 parent 22f2f98 commit 9ff9c70
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/app/plugin/src/ios/appDelegate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import fs from 'fs';
const methodInvocationBlock = `[FIRApp configure];`;
// https://regex101.com/r/mPgaq6/1
const methodInvocationLineMatcher =
/(?:(self\.|_)(\w+)\s?=\s?\[\[UMModuleRegistryAdapter alloc\])|(?:RCTBridge\s?\*\s?(\w+)\s?=\s?\[(\[RCTBridge alloc\]|self\.reactDelegate))(?:(self\.|_)(\w+)\s?=\s?\[\[UMModuleRegistryAdapter alloc\])|(?:RCTBridge\s?\*\s?(\w+)\s?=\s?\[(\[RCTBridge alloc\]|self\.reactDelegate))/g;
/(?:(self\.|_)(\w+)\s?=\s?\[\[UMModuleRegistryAdapter alloc\])|(?:RCTBridge\s?\*\s?(\w+)\s?=\s?\[(\[RCTBridge alloc\]|self\.reactDelegate))/g;

// https://regex101.com/r/nHrTa9/1/
// if the above regex fails, we can use this one as a fallback:
Expand Down Expand Up @@ -73,7 +73,6 @@ export const withFirebaseAppDelegate: ConfigPlugin = config => {
async config => {
const fileInfo = IOSConfig.Paths.getAppDelegate(config.modRequest.projectRoot);
let contents = await fs.promises.readFile(fileInfo.path, 'utf-8');
WarningAggregator.addWarningIOS('dupa', `${config.sdkVersion}`);
if (fileInfo.language === 'objc') {
contents = modifyObjcAppDelegate(contents);
} else {
Expand Down

0 comments on commit 9ff9c70

Please sign in to comment.