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",
|
"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)",
|
"description": "command line tool for react-native-update (remote updates for react native)",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
|||||||
@@ -85,14 +85,30 @@ async function runReactNativeBundleCommand({
|
|||||||
|
|
||||||
const getExpoCli = () => {
|
const getExpoCli = () => {
|
||||||
try {
|
try {
|
||||||
|
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', {
|
cliPath = require.resolve('@expo/cli', {
|
||||||
paths: [process.cwd()],
|
paths: searchPaths,
|
||||||
});
|
});
|
||||||
|
|
||||||
const expoCliVersion = JSON.parse(
|
const expoCliVersion = JSON.parse(
|
||||||
fs
|
fs
|
||||||
.readFileSync(
|
.readFileSync(
|
||||||
require.resolve('@expo/cli/package.json', {
|
require.resolve('@expo/cli/package.json', {
|
||||||
paths: [process.cwd()],
|
paths: searchPaths,
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
.toString(),
|
.toString(),
|
||||||
|
|||||||
Reference in New Issue
Block a user