pulse-updates 1.3.3 → 1.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/scripts/publish.mjs +12 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pulse-updates",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.4",
|
|
4
4
|
"description": "Pulse app-experience SDK for React Native: updates, config, experiments, events, decisions and first-party links",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
package/scripts/publish.mjs
CHANGED
|
@@ -495,11 +495,18 @@ function parseArgs() {
|
|
|
495
495
|
/**
|
|
496
496
|
* Find Info.plist and return its path and content
|
|
497
497
|
*/
|
|
498
|
+
export function selectIOSInfoPlist(candidates) {
|
|
499
|
+
return candidates.find(({ content }) => /<key>PulseUpdatesURL<\/key>/.test(content)) ||
|
|
500
|
+
candidates[0] ||
|
|
501
|
+
null;
|
|
502
|
+
}
|
|
503
|
+
|
|
498
504
|
function findInfoPlist() {
|
|
499
505
|
const possiblePaths = [
|
|
500
506
|
'ios/App/Info.plist',
|
|
501
507
|
'ios/*/Info.plist',
|
|
502
508
|
];
|
|
509
|
+
const candidates = [];
|
|
503
510
|
|
|
504
511
|
for (const pattern of possiblePaths) {
|
|
505
512
|
if (pattern.includes('*')) {
|
|
@@ -512,25 +519,25 @@ function findInfoPlist() {
|
|
|
512
519
|
const plistPath = path.join(baseDir, dir, 'Info.plist');
|
|
513
520
|
if (fs.existsSync(plistPath)) {
|
|
514
521
|
try {
|
|
515
|
-
|
|
522
|
+
candidates.push({
|
|
516
523
|
path: plistPath,
|
|
517
524
|
content: fs.readFileSync(plistPath, 'utf8'),
|
|
518
|
-
};
|
|
525
|
+
});
|
|
519
526
|
} catch {}
|
|
520
527
|
}
|
|
521
528
|
}
|
|
522
529
|
}
|
|
523
530
|
} else if (fs.existsSync(pattern)) {
|
|
524
531
|
try {
|
|
525
|
-
|
|
532
|
+
candidates.push({
|
|
526
533
|
path: pattern,
|
|
527
534
|
content: fs.readFileSync(pattern, 'utf8'),
|
|
528
|
-
};
|
|
535
|
+
});
|
|
529
536
|
} catch {}
|
|
530
537
|
}
|
|
531
538
|
}
|
|
532
539
|
|
|
533
|
-
return
|
|
540
|
+
return selectIOSInfoPlist(candidates);
|
|
534
541
|
}
|
|
535
542
|
|
|
536
543
|
/**
|