From d7c7e27eaae305c050dc800273518b447a147c00 Mon Sep 17 00:00:00 2001 From: sunnylqm Date: Fri, 6 Dec 2019 15:24:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Duse=5Fframeworks=E6=97=B6?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E8=8E=B7=E5=8F=96=E7=BC=96=E8=AF=91=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E6=88=B3=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- local-cli/src/utils/index.js | 13 ++++++++----- react-native-update.podspec | 1 + 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/local-cli/src/utils/index.js b/local-cli/src/utils/index.js index 8831f64..48e6dba 100644 --- a/local-cli/src/utils/index.js +++ b/local-cli/src/utils/index.js @@ -71,11 +71,14 @@ export async function getApkInfo(fn) { export async function getIpaInfo(fn) { const appInfoParser = new AppInfoParser(fn); const { CFBundleShortVersionString: versionName } = await appInfoParser.parse(); - try { - const buildTimeTxtBuffer = await appInfoParser.parser.getEntry(/payload\/.+?\.app\/pushy_build_time.txt/); - const buildTime = buildTimeTxtBuffer.toString().replace('\n', ''); - return { versionName, buildTime }; - } catch (e) { + let buildTimeTxtBuffer = await appInfoParser.parser.getEntry(/payload\/.+?\.app\/pushy_build_time.txt/); + if (!buildTimeTxtBuffer) { + // Not in root bundle when use `use_frameworks` + buildTimeTxtBuffer = await appInfoParser.parser.getEntry(/payload\/.+?\.app\/frameworks\/react_native_update.framework\/pushy_build_time.txt/); + } + if (!buildTimeTxtBuffer) { throw new Error('Can not get build time for this app.'); } + const buildTime = buildTimeTxtBuffer.toString().replace('\n', ''); + return { versionName, buildTime }; } diff --git a/react-native-update.podspec b/react-native-update.podspec index 1c688d4..33d0105 100644 --- a/react-native-update.podspec +++ b/react-native-update.podspec @@ -11,6 +11,7 @@ Pod::Spec.new do |s| s.authors = package['author'] s.homepage = package['homepage'] + s.cocoapods_version = '>= 1.6.0' s.platform = :ios, "8.0" s.source = { :git => 'https://github.com/reactnativecn/react-native-pushy.git', :tag => '#{s.version}' } s.libraries = 'bz2', 'z'