Skip to content

Commit ef7f6a2

Browse files
committed
Swap React Native CLI paths based on version compatibility in runReactNativeBundleCommand function
1 parent d2798d3 commit ef7f6a2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-update-cli",
3-
"version": "1.42.0",
3+
"version": "1.42.1",
44
"description": "Command tools for javaScript updater with `pushy` service for react native apps.",
55
"main": "index.js",
66
"bin": {

Diff for: src/bundle.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,13 @@ async function runReactNativeBundleCommand({
102102

103103
const getRnCli = () => {
104104
try {
105-
// rn >= 0.75
106-
cliPath = require.resolve('@react-native-community/cli/build/bin.js', {
105+
// rn < 0.75
106+
cliPath = require.resolve('react-native/local-cli/cli.js', {
107107
paths: [process.cwd()],
108108
});
109109
} catch (e) {
110-
// rn < 0.75
111-
cliPath = require.resolve('react-native/local-cli/cli.js', {
110+
// rn >= 0.75
111+
cliPath = require.resolve('@react-native-community/cli/build/bin.js', {
112112
paths: [process.cwd()],
113113
});
114114
}

0 commit comments

Comments
 (0)