1
0
mirror of https://gitcode.com/gh_mirrors/re/react-native-pushy.git synced 2025-10-31 21:33:12 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee

修复use_frameworks时无法获取编译时间戳的问题

This commit is contained in:
sunnylqm
2019-12-06 15:24:49 +08:00
parent e9e60bc5c6
commit d7c7e27eaa
2 changed files with 9 additions and 5 deletions

View File

@@ -71,11 +71,14 @@ export async function getApkInfo(fn) {
export async function getIpaInfo(fn) { export async function getIpaInfo(fn) {
const appInfoParser = new AppInfoParser(fn); const appInfoParser = new AppInfoParser(fn);
const { CFBundleShortVersionString: versionName } = await appInfoParser.parse(); const { CFBundleShortVersionString: versionName } = await appInfoParser.parse();
try { let buildTimeTxtBuffer = await appInfoParser.parser.getEntry(/payload\/.+?\.app\/pushy_build_time.txt/);
const buildTimeTxtBuffer = await appInfoParser.parser.getEntry(/payload\/.+?\.app\/pushy_build_time.txt/); if (!buildTimeTxtBuffer) {
const buildTime = buildTimeTxtBuffer.toString().replace('\n', ''); // Not in root bundle when use `use_frameworks`
return { versionName, buildTime }; buildTimeTxtBuffer = await appInfoParser.parser.getEntry(/payload\/.+?\.app\/frameworks\/react_native_update.framework\/pushy_build_time.txt/);
} catch (e) { }
if (!buildTimeTxtBuffer) {
throw new Error('Can not get build time for this app.'); throw new Error('Can not get build time for this app.');
} }
const buildTime = buildTimeTxtBuffer.toString().replace('\n', '');
return { versionName, buildTime };
} }

View File

@@ -11,6 +11,7 @@ Pod::Spec.new do |s|
s.authors = package['author'] s.authors = package['author']
s.homepage = package['homepage'] s.homepage = package['homepage']
s.cocoapods_version = '>= 1.6.0'
s.platform = :ios, "8.0" s.platform = :ios, "8.0"
s.source = { :git => 'https://github.com/reactnativecn/react-native-pushy.git', :tag => '#{s.version}' } s.source = { :git => 'https://github.com/reactnativecn/react-native-pushy.git', :tag => '#{s.version}' }
s.libraries = 'bz2', 'z' s.libraries = 'bz2', 'z'