1
0
mirror of https://gitcode.com/github-mirrors/react-native-update-cli.git synced 2025-09-16 01:41:37 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee

Swap React Native CLI paths based on version compatibility in runReactNativeBundleCommand function

This commit is contained in:
sunnylqm
2025-03-17 11:25:11 +08:00
parent d2798d3177
commit ef7f6a2087
2 changed files with 5 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "react-native-update-cli",
"version": "1.42.0",
"version": "1.42.1",
"description": "Command tools for javaScript updater with `pushy` service for react native apps.",
"main": "index.js",
"bin": {

View File

@@ -102,13 +102,13 @@ async function runReactNativeBundleCommand({
const getRnCli = () => {
try {
// rn >= 0.75
cliPath = require.resolve('@react-native-community/cli/build/bin.js', {
// rn < 0.75
cliPath = require.resolve('react-native/local-cli/cli.js', {
paths: [process.cwd()],
});
} catch (e) {
// rn < 0.75
cliPath = require.resolve('react-native/local-cli/cli.js', {
// rn >= 0.75
cliPath = require.resolve('@react-native-community/cli/build/bin.js', {
paths: [process.cwd()],
});
}