Skip to content

Commit 6751daf

Browse files
committed
Update version to 2.3.2 in package.json and enhance search paths for @expo/cli in runReactNativeBundleCommand to include expo package directory.
1 parent b973ace commit 6751daf

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-update-cli",
3-
"version": "2.3.1",
3+
"version": "2.3.2",
44
"description": "command line tool for react-native-update (remote updates for react native)",
55
"main": "index.js",
66
"bin": {

src/bundle.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,30 @@ async function runReactNativeBundleCommand({
8585

8686
const getExpoCli = () => {
8787
try {
88+
const searchPaths = [process.cwd()];
89+
90+
// 尝试添加 expo 包的路径作为额外的搜索路径
91+
try {
92+
const expoPath = require.resolve('expo/package.json', {
93+
paths: [process.cwd()],
94+
});
95+
// 获取 expo 包的目录路径
96+
const expoDir = expoPath.replace(/\/package\.json$/, '');
97+
searchPaths.push(expoDir);
98+
} catch {
99+
// expo 包不存在,忽略
100+
}
101+
102+
// 尝试从搜索路径中解析 @expo/cli
88103
cliPath = require.resolve('@expo/cli', {
89-
paths: [process.cwd()],
104+
paths: searchPaths,
90105
});
106+
91107
const expoCliVersion = JSON.parse(
92108
fs
93109
.readFileSync(
94110
require.resolve('@expo/cli/package.json', {
95-
paths: [process.cwd()],
111+
paths: searchPaths,
96112
}),
97113
)
98114
.toString(),

0 commit comments

Comments
 (0)