Skip to content

Commit

Permalink
fix(app, expo): node 12 compatibility with fs.promises in ios plugin (
Browse files Browse the repository at this point in the history
  • Loading branch information
barthap authored Aug 13, 2021
1 parent 90476b8 commit 97f9090
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/app/plugin/src/ios/appDelegate.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ConfigPlugin, IOSConfig, withDangerousMod } from '@expo/config-plugins';
import fs from 'fs/promises';
import fs from 'fs';

const methodInvocationBlock = `[FIRApp configure];`;

Expand Down Expand Up @@ -31,7 +31,7 @@ export const withFirebaseAppDelegate: ConfigPlugin = config => {
'ios',
async config => {
const fileInfo = IOSConfig.Paths.getAppDelegate(config.modRequest.projectRoot);
let contents = await fs.readFile(fileInfo.path, 'utf-8');
let contents = await fs.promises.readFile(fileInfo.path, 'utf-8');
if (fileInfo.language === 'objc') {
contents = modifyObjcAppDelegate(contents);
} else {
Expand All @@ -40,7 +40,7 @@ export const withFirebaseAppDelegate: ConfigPlugin = config => {
`Cannot add Firebase code to AppDelegate of language "${fileInfo.language}"`,
);
}
await fs.writeFile(fileInfo.path, contents);
await fs.promises.writeFile(fileInfo.path, contents);

return config;
},
Expand Down

1 comment on commit 97f9090

@vercel
Copy link

@vercel vercel bot commented on 97f9090 Aug 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.