Skip to content

Commit

Permalink
Fix running expo prebuild after Podfile modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
zoontek committed Oct 18, 2024
1 parent 8b4a6b3 commit e380b10
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
4 changes: 2 additions & 2 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1499,7 +1499,7 @@ PODS:
- React-logger (= 0.75.4)
- React-perflogger (= 0.75.4)
- React-utils (= 0.75.4)
- RNPermissions (5.0.0):
- RNPermissions (5.0.1):
- React-Core
- RNVectorIcons (10.2.0):
- DoubleConversion
Expand Down Expand Up @@ -1794,7 +1794,7 @@ SPEC CHECKSUMS:
React-utils: cbe8b8b3d7b2ac282e018e46f0e7b25cdc87c5a0
ReactCodegen: 4bcb34e6b5ebf6eef5cee34f55aa39991ea1c1f1
ReactCommon: 6a952e50c2a4b694731d7682aaa6c79bc156e4ad
RNPermissions: 71b219b536d93ecf39169432f1037f6cb45aa9ec
RNPermissions: ed7216b9f49ed98b6cf56b8030de68b9a10b2423
RNVectorIcons: 6382277afab3c54658e9d555ee0faa7a37827136
SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d
Yoga: 055f92ad73f8c8600a93f0e25ac0b2344c3b07e6
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-permissions",
"version": "5.0.0",
"version": "5.0.1",
"license": "MIT",
"description": "An unified permissions API for React Native on iOS, Android and Windows",
"author": "Mathieu Acthernoene <[email protected]>",
Expand Down
11 changes: 2 additions & 9 deletions src/expo.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ConfigPlugin, withDangerousMod} from '@expo/config-plugins';
import {ConfigPlugin, createRunOncePlugin, withDangerousMod} from '@expo/config-plugins';
import {mergeContents} from '@expo/config-plugins/build/utils/generateCode';
import * as fs from 'fs/promises';
import * as path from 'path';
Expand Down Expand Up @@ -60,16 +60,9 @@ ${iosPermissions.map((permission) => ` '${permission}',`).join('\n')}
comment: '#',
});

if (!withRequire.didMerge || !withSetup.didMerge) {
console.error(
"ERROR: Cannot add react-native-permissions to the project's ios/Podfile because it's malformed. Please report this with a copy of your project Podfile.",
);
return config;
}

await fs.writeFile(file, withSetup.contents, 'utf-8');
return config;
},
]);

export default withPermissions;
export default createRunOncePlugin(withPermissions, 'react-native-permissions');

0 comments on commit e380b10

Please sign in to comment.