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

fix expo cli on windows

This commit is contained in:
sunnylqm
2024-08-22 17:15:17 +08:00
parent 5740a3315c
commit 5302c8968f

View File

@@ -54,6 +54,7 @@ async function runReactNativeBundleCommand(
let cliPath = require.resolve('react-native/local-cli/cli.js', {
paths: [process.cwd()],
});
let usingExpo = false;
try {
require.resolve('expo-router', {
paths: [process.cwd()],
@@ -64,10 +65,9 @@ async function runReactNativeBundleCommand(
cliPath = require.resolve('@expo/cli', {
paths: [process.cwd()],
});
usingExpo = true;
} catch (e) {}
const bundleCommand = cliPath.includes('@expo/cli')
? 'export:embed'
: 'bundle';
const bundleCommand = usingExpo ? 'export:embed' : 'bundle';
Array.prototype.push.apply(reactNativeBundleArgs, [
cliPath,