Skip to content

Commit ffebb54

Browse files
committed
Update config key
1 parent 3d147b2 commit ffebb54

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"start": "react-native start",
1212
"reinstall": "yarn clean && yarn install"
1313
},
14-
"iosPermissions": [
14+
"reactNativePermissionsIOS": [
1515
"AppTrackingTransparency",
1616
"BluetoothPeripheral",
1717
"Calendars",

react-native.config.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ const fs = require('fs/promises');
33
const path = require('path');
44
const pc = require('picocolors');
55

6+
const CONFIG_KEY = 'reactNativePermissionsIOS';
7+
68
const log = {
79
error: (text) => console.log(pc.red(text)),
810
warning: (text) => console.log(pc.yellow(text)),
@@ -15,12 +17,12 @@ module.exports = {
1517
description:
1618
'Update react-native-permissions podspec to link additional permission handlers.',
1719
func: async () => {
18-
const explorer = await cosmiconfig('iosPermissions');
20+
const explorer = await cosmiconfig(CONFIG_KEY);
1921
const result = await explorer.search();
2022

2123
if (!result) {
2224
log.error(
23-
'No config detected. In order to setup iOS permissions, you first need to add an "iosPermissions" array in your package.json.',
25+
`No config detected. In order to setup iOS permissions, you first need to add an "${CONFIG_KEY}" array in your package.json.`,
2426
);
2527

2628
process.exit(1);
@@ -29,7 +31,7 @@ module.exports = {
2931
const {config} = result;
3032

3133
if (!Array.isArray(config) || config.length === 0) {
32-
log.error('Invalid "iosPermissions" config detected. It must be a non-empty array.');
34+
log.error(`Invalid "${CONFIG_KEY}" config detected. It must be a non-empty array.`);
3335
process.exit(1);
3436
}
3537

0 commit comments

Comments
 (0)