Closed deankwankkk closed 2 years ago
老哥 你可以在 Fastfile
里使用 ruby 语法的 pgyer 返回 BuildInfo 的信息 你可以 puts 出来
如果你不熟悉ruby 语法, 也可以用命令行捕捉 fastlane 的输出 grep 'Upload success. Visit this URL to see:'
老哥 你可以在
Fastfile
里使用 ruby 语法的 pgyer 返回 BuildInfo 的信息 你可以 puts 出来如果你不熟悉ruby 语法, 也可以用命令行捕捉 fastlane 的输出 grep 'Upload success. Visit this URL to see:'
的确不熟悉ruby,谢谢大神
FYI
... ...
temp_file = 'builds/pgy_output.log'
UtilHelper.redirect_stdout_to_file(temp_file) {
pgyer(api_key: "api_key")
}
File.readlines(temp_file).each do |line|
if line.include? "Upload success. BuildInfo is"
match = line.match(/(\{.*\})/)
map = JSON.parse match[1].gsub('=>', ':')
puts(map)
end
end
... ...
class UtilHelper
# Redirects standard output and standard error to a file
# (currently only way we know how to capture fastlane ui messages)
def self.redirect_stdout_to_file(filename)
original_stdout = $stdout.clone
original_stderr = $stderr.clone
$stderr.reopen File.new(filename, 'w')
$stdout.reopen File.new(filename, 'w')
yield
ensure
$stdout.reopen original_stdout
$stderr.reopen original_stderr
end
end
通过插件,上传到pyger平台成功后,如何获取pyger的下载地址?