Skip to content

Commit d51ef37

Browse files
authored
Update index.js
1 parent 90a59cf commit d51ef37

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/utils/index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import os from 'os';
33
import path from 'path';
44
import pkg from '../../package.json';
55
import AppInfoParser from './app-info-parser';
6-
import semverLt from 'semver/functions/lt';
6+
import semverSatisfies from 'semver/functions/satisfies';
77

88
import read from 'read';
99

@@ -152,12 +152,11 @@ export function printVersionCommand() {
152152
console.log('react-native-update: 无法获取版本号,请在项目目录中运行命令');
153153
}
154154
if (pushyVersion) {
155-
if (semverLt(pushyVersion, '8.5.1')) {
155+
if (semverSatisfies(pushyVersion, '<8.5.1')) {
156156
console.warn(
157157
'当前版本已不再支持,请至少升级到 v8 的最新小版本后重新打包(代码无需改动): npm i react-native-update@8',
158158
);
159-
}
160-
if (semverLt(pushyVersion, '9.2.1')) {
159+
} else if (semverSatisfies(pushyVersion, '9.0.0 - 9.2.0')) {
161160
console.warn(
162161
'当前版本已不再支持,请至少升级到 v9 的最新小版本后重新打包(代码无需改动): npm i react-native-update@9',
163162
);

0 commit comments

Comments
 (0)