react-native-update-cli 1.30.0 → 1.30.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api.js +3 -1
- package/lib/utils/index.js +4 -5
- package/package.json +1 -1
- package/src/api.js +3 -1
- package/src/utils/index.js +3 -4
package/lib/api.js
CHANGED
|
@@ -195,7 +195,9 @@ async function uploadFile(fn, key) {
|
|
|
195
195
|
return reject(err);
|
|
196
196
|
}
|
|
197
197
|
if (resp.statusCode > 299) {
|
|
198
|
-
return reject(Object.assign(new Error(body), {
|
|
198
|
+
return reject(Object.assign(new Error(JSON.stringify(body)), {
|
|
199
|
+
status: resp.statusCode
|
|
200
|
+
}));
|
|
199
201
|
}
|
|
200
202
|
resolve({ hash: formData.key });
|
|
201
203
|
});
|
package/lib/utils/index.js
CHANGED
|
@@ -35,9 +35,9 @@ var _appInfoParser = require('./app-info-parser');
|
|
|
35
35
|
|
|
36
36
|
var _appInfoParser2 = _interopRequireDefault(_appInfoParser);
|
|
37
37
|
|
|
38
|
-
var
|
|
38
|
+
var _satisfies = require('semver/functions/satisfies');
|
|
39
39
|
|
|
40
|
-
var
|
|
40
|
+
var _satisfies2 = _interopRequireDefault(_satisfies);
|
|
41
41
|
|
|
42
42
|
var _read = require('read');
|
|
43
43
|
|
|
@@ -157,10 +157,9 @@ function printVersionCommand() {
|
|
|
157
157
|
console.log('react-native-update: 无法获取版本号,请在项目目录中运行命令');
|
|
158
158
|
}
|
|
159
159
|
if (pushyVersion) {
|
|
160
|
-
if ((0,
|
|
160
|
+
if ((0, _satisfies2.default)(pushyVersion, '<8.5.1')) {
|
|
161
161
|
console.warn('当前版本已不再支持,请至少升级到 v8 的最新小版本后重新打包(代码无需改动): npm i react-native-update@8');
|
|
162
|
-
}
|
|
163
|
-
if ((0, _lt2.default)(pushyVersion, '9.2.1')) {
|
|
162
|
+
} else if ((0, _satisfies2.default)(pushyVersion, '9.0.0 - 9.2.0')) {
|
|
164
163
|
console.warn('当前版本已不再支持,请至少升级到 v9 的最新小版本后重新打包(代码无需改动): npm i react-native-update@9');
|
|
165
164
|
}
|
|
166
165
|
}
|
package/package.json
CHANGED
package/src/api.js
CHANGED
|
@@ -166,7 +166,9 @@ export async function uploadFile(fn, key) {
|
|
|
166
166
|
}
|
|
167
167
|
if (resp.statusCode > 299) {
|
|
168
168
|
return reject(
|
|
169
|
-
Object.assign(new Error(body), {
|
|
169
|
+
Object.assign(new Error(JSON.stringify(body)), {
|
|
170
|
+
status: resp.statusCode,
|
|
171
|
+
}),
|
|
170
172
|
);
|
|
171
173
|
}
|
|
172
174
|
resolve({ hash: formData.key });
|
package/src/utils/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import os from 'os';
|
|
|
3
3
|
import path from 'path';
|
|
4
4
|
import pkg from '../../package.json';
|
|
5
5
|
import AppInfoParser from './app-info-parser';
|
|
6
|
-
import
|
|
6
|
+
import semverSatisfies from 'semver/functions/satisfies';
|
|
7
7
|
|
|
8
8
|
import read from 'read';
|
|
9
9
|
|
|
@@ -152,12 +152,11 @@ export function printVersionCommand() {
|
|
|
152
152
|
console.log('react-native-update: 无法获取版本号,请在项目目录中运行命令');
|
|
153
153
|
}
|
|
154
154
|
if (pushyVersion) {
|
|
155
|
-
if (
|
|
155
|
+
if (semverSatisfies(pushyVersion, '<8.5.1')) {
|
|
156
156
|
console.warn(
|
|
157
157
|
'当前版本已不再支持,请至少升级到 v8 的最新小版本后重新打包(代码无需改动): npm i react-native-update@8',
|
|
158
158
|
);
|
|
159
|
-
}
|
|
160
|
-
if (semverLt(pushyVersion, '9.2.1')) {
|
|
159
|
+
} else if (semverSatisfies(pushyVersion, '9.0.0 - 9.2.0')) {
|
|
161
160
|
console.warn(
|
|
162
161
|
'当前版本已不再支持,请至少升级到 v9 的最新小版本后重新打包(代码无需改动): npm i react-native-update@9',
|
|
163
162
|
);
|