@@ -3,6 +3,7 @@ import os from 'os';
33import path from 'path' ;
44import pkg from '../../package.json' ;
55import AppInfoParser from './app-info-parser' ;
6+ import semverLt from 'semver/functions/lt' ;
67
78import read from 'read' ;
89
@@ -83,7 +84,7 @@ export async function getApkInfo(fn) {
8384 }
8485 if ( buildTime == 0 ) {
8586 throw new Error (
86- '无法获取此包的编译时间戳。请更新react -native-update到最新版本后重新打包上传 。' ,
87+ '无法获取此包的编译时间戳。请更新 react -native-update 到最新版本后重新打包上传 。' ,
8788 ) ;
8889 }
8990 return { versionName, buildTime, ...appCredential } ;
@@ -119,7 +120,7 @@ export async function getIpaInfo(fn) {
119120 }
120121 if ( ! buildTimeTxtBuffer ) {
121122 throw new Error (
122- '无法获取此包的编译时间戳。请更新react -native-update到最新版本后重新打包上传 。' ,
123+ '无法获取此包的编译时间戳。请更新 react -native-update 到最新版本后重新打包上传 。' ,
123124 ) ;
124125 }
125126 const buildTime = buildTimeTxtBuffer . toString ( ) . replace ( '\n' , '' ) ;
@@ -137,17 +138,31 @@ export function saveToLocal(originPath, destName) {
137138
138139export function printVersionCommand ( ) {
139140 console . log ( 'react-native-update-cli: ' + pkg . version ) ;
141+ let pushyVersion = '' ;
140142 try {
141143 const PACKAGE_JSON_PATH = require . resolve (
142144 'react-native-update/package.json' ,
143145 {
144146 paths : [ process . cwd ( ) ] ,
145147 } ,
146148 ) ;
147- console . log ( 'react-native-update: ' + require ( PACKAGE_JSON_PATH ) . version ) ;
149+ pushyVersion = require ( PACKAGE_JSON_PATH ) . version ;
150+ console . log ( 'react-native-update: ' + pushyVersion ) ;
148151 } catch ( e ) {
149152 console . log ( 'react-native-update: 无法获取版本号,请在项目目录中运行命令' ) ;
150153 }
154+ if ( pushyVersion ) {
155+ if ( semverLt ( pushyVersion , '8.5.1' ) ) {
156+ console . warn (
157+ '当前版本已不再支持,请至少升级到 v8 的最新小版本后重新打包(代码无需改动): npm i react-native-update@8' ,
158+ ) ;
159+ }
160+ if ( semverLt ( pushyVersion , '9.2.1' ) ) {
161+ console . warn (
162+ '当前版本已不再支持,请至少升级到 v9 的最新小版本后重新打包(代码无需改动): npm i react-native-update@9' ,
163+ ) ;
164+ }
165+ }
151166}
152167
153168export const pricingPageUrl = 'https://pushy.reactnative.cn/pricing.html' ;
0 commit comments