mirror of
https://gitcode.com/github-mirrors/react-native-update-cli.git
synced 2025-11-22 16:26:10 +08:00
Update version to 2.3.2 in package.json and enhance search paths for @expo/cli in runReactNativeBundleCommand to include expo package directory.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-native-update-cli",
|
||||
"version": "2.3.1",
|
||||
"version": "2.3.2",
|
||||
"description": "command line tool for react-native-update (remote updates for react native)",
|
||||
"main": "index.js",
|
||||
"bin": {
|
||||
|
||||
@@ -85,14 +85,30 @@ async function runReactNativeBundleCommand({
|
||||
|
||||
const getExpoCli = () => {
|
||||
try {
|
||||
cliPath = require.resolve('@expo/cli', {
|
||||
const searchPaths = [process.cwd()];
|
||||
|
||||
// 尝试添加 expo 包的路径作为额外的搜索路径
|
||||
try {
|
||||
const expoPath = require.resolve('expo/package.json', {
|
||||
paths: [process.cwd()],
|
||||
});
|
||||
// 获取 expo 包的目录路径
|
||||
const expoDir = expoPath.replace(/\/package\.json$/, '');
|
||||
searchPaths.push(expoDir);
|
||||
} catch {
|
||||
// expo 包不存在,忽略
|
||||
}
|
||||
|
||||
// 尝试从搜索路径中解析 @expo/cli
|
||||
cliPath = require.resolve('@expo/cli', {
|
||||
paths: searchPaths,
|
||||
});
|
||||
|
||||
const expoCliVersion = JSON.parse(
|
||||
fs
|
||||
.readFileSync(
|
||||
require.resolve('@expo/cli/package.json', {
|
||||
paths: [process.cwd()],
|
||||
paths: searchPaths,
|
||||
}),
|
||||
)
|
||||
.toString(),
|
||||
|
||||
Reference in New Issue
Block a user