From 51565444dd4c0ed626b2e3fab06ef767be8525f7 Mon Sep 17 00:00:00 2001 From: NaixSpirit Date: Thu, 10 Mar 2016 13:59:59 +0800 Subject: [PATCH 1/6] close #73 automake user output folder --- lib/fir/util/build_common.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/fir/util/build_common.rb b/lib/fir/util/build_common.rb index 002df76..644f1d1 100644 --- a/lib/fir/util/build_common.rb +++ b/lib/fir/util/build_common.rb @@ -47,7 +47,11 @@ module FIR FileUtils.mkdir_p(output_path) unless File.exist?(output_path) output_path else - File.absolute_path(options[:output].to_s) + output_path = options[:output].to_s + unless File.exist?(output_path) + logger.warn "The output path not exist and fir-cli will autocreate it..." + end + File.absolute_path(output_path) end end From 3210ddf96db6302d224736227669af6ad662f838 Mon Sep 17 00:00:00 2001 From: NaixSpirit Date: Fri, 18 Mar 2016 17:41:12 +0800 Subject: [PATCH 2/6] close #76 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加 publish 后的输出文件 --- lib/fir/util/config.rb | 5 +++++ lib/fir/util/publish.rb | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/fir/util/config.rb b/lib/fir/util/config.rb index 2e7782d..01b958f 100644 --- a/lib/fir/util/config.rb +++ b/lib/fir/util/config.rb @@ -3,6 +3,7 @@ module FIR module Config CONFIG_PATH = "#{ENV['HOME']}/.fir-cli" + APP_INFO_PATH = "#{ENV['HOME']}/.fir-cli-app" API_YML_PATH = File.expand_path('../../', __FILE__) + '/api.yml' APP_FILE_TYPE = %w(.ipa .apk).freeze @@ -27,6 +28,10 @@ module FIR File.open(CONFIG_PATH, 'w+') { |f| f << YAML.dump(hash) } end + def write_app_info(hash) + File.open(APP_INFO_PATH, 'w+') { |f| f << YAML.dump(hash) } + end + def current_token @token ||= config[:token] if config end diff --git a/lib/fir/util/publish.rb b/lib/fir/util/publish.rb index 64fc611..37adf58 100644 --- a/lib/fir/util/publish.rb +++ b/lib/fir/util/publish.rb @@ -40,6 +40,7 @@ module FIR upload_app_binary upload_device_info update_app_info + fetch_app_info end def upload_app_icon @@ -123,7 +124,8 @@ module FIR def fetch_app_info logger.info 'Fetch app info from fir.im' - get fir_api[:app_url] + "/#{@app_id}", api_token: @token + @fir_app_info = get(fir_api[:app_url] + "/#{@app_id}", api_token: @token) + write_app_info(id: @fir_app_info[:id], short: @fir_app_info[:short], name: @fir_app_info[:name]) end def upload_mapping_file_with_publish(options) @@ -138,7 +140,7 @@ module FIR end def logger_info_app_short_and_qrcode - short = "#{fir_api[:domain]}/#{fetch_app_info[:short]}" + short = "#{fir_api[:domain]}/#{@fir_app_info[:short]}" logger.info "Published succeed: #{short}" From ee64a2e942aadf9e557855eb4e4c185ade1aedec Mon Sep 17 00:00:00 2001 From: NaixSpirit Date: Fri, 18 Mar 2016 17:46:22 +0800 Subject: [PATCH 3/6] fix test --- lib/fir/util/publish.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/fir/util/publish.rb b/lib/fir/util/publish.rb index 37adf58..4cac39a 100644 --- a/lib/fir/util/publish.rb +++ b/lib/fir/util/publish.rb @@ -126,6 +126,7 @@ module FIR @fir_app_info = get(fir_api[:app_url] + "/#{@app_id}", api_token: @token) write_app_info(id: @fir_app_info[:id], short: @fir_app_info[:short], name: @fir_app_info[:name]) + @fir_app_info end def upload_mapping_file_with_publish(options) From 0297cb78b0c3e4843626df062b3a76f9575b295f Mon Sep 17 00:00:00 2001 From: NaixSpirit Date: Wed, 23 Mar 2016 17:13:39 +0800 Subject: [PATCH 4/6] fix #77 add rescue when icons is nil --- lib/fir/util/parser/apk.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/fir/util/parser/apk.rb b/lib/fir/util/parser/apk.rb index f69816b..d04ff94 100644 --- a/lib/fir/util/parser/apk.rb +++ b/lib/fir/util/parser/apk.rb @@ -31,7 +31,11 @@ module FIR # @apk.icon is a hash, { icon_name: icon_binary_data } def tmp_icons - @apk.icon.map { |_, data| generate_tmp_icon(data, :apk) } + begin + @apk.icon.map { |_, data| generate_tmp_icon(data, :apk) } + rescue + [] + end end end end From b372f568e99c435403b95ddb0dbd94e0ea99e431 Mon Sep 17 00:00:00 2001 From: NaixSpirit Date: Wed, 4 May 2016 11:14:35 +0800 Subject: [PATCH 5/6] =?UTF-8?q?--open=20=E5=8F=82=E6=95=B0=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/publish.md | 5 ++--- lib/fir/cli.rb | 4 ++-- lib/fir/util/publish.rb | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/doc/publish.md b/doc/publish.md index c2e860b..c467ec6 100644 --- a/doc/publish.md +++ b/doc/publish.md @@ -13,8 +13,7 @@ Options: -Q, [--qrcode], [--no-qrcode] # Generate qrcode -m, [--mappingfile=MAPPINGFILE] # App mapping file -P, [--proj=PROJ] # Project id in BugHD.com if upload app mapping file - [--open], [--no-open] # true/false if open for everyone, the default is: true - # Default: true + [--open], [--no-open] # true/false if open for everyone [--password=PASSWORD] # Set password for app -T, [--token=TOKEN] # User's API Token at fir.im -L, [--logfile=LOGFILE] # Path to writable logfile @@ -31,6 +30,6 @@ Options: - `-Q` 参数, 是否生成发布后二维码, 默认为不生成, 加上 `-Q` 参数后会在当前目录生成一张二维码图片, 扫描该图片即可下载该应用. - `-m` 参数, 上传当前应用的符号表文件, 配合 `-P` 参数使用. - `-P` 参数, [BugHD.com](http://bughd.com) 上相对应的 Project id. -- `--open` 参数, 设置发布后的应用是否开放给所有人下载, 默认为开放, 关闭开放使用 `--no-open` 参数. +- `--open` 参数, 设置发布后的应用是否开放给所有人下载, 关闭开放使用 `--no-open` 参数. - `--password` 参数, 设置发布后的应用密码 diff --git a/lib/fir/cli.rb b/lib/fir/cli.rb index c92a845..5434e74 100644 --- a/lib/fir/cli.rb +++ b/lib/fir/cli.rb @@ -40,7 +40,7 @@ module FIR method_option :qrcode, type: :boolean, aliases: '-Q', desc: 'Generate qrcode' method_option :mapping, type: :boolean, aliases: '-M', desc: 'true/false if upload app mapping file to BugHD.com' method_option :proj, type: :string, aliases: '-P', desc: 'Project id in BugHD.com if upload app mapping file' - method_option :open, type: :boolean, desc: 'true/false if open for everyone, the default is: true', default: true + method_option :open, type: :boolean, desc: 'true/false if open for everyone' method_option :password, type: :string, desc: 'Set password for app' def build_ipa(*args) prepare :build_ipa @@ -106,7 +106,7 @@ module FIR method_option :qrcode, type: :boolean, aliases: '-Q', desc: 'Generate qrcode' method_option :mappingfile, type: :string, aliases: '-m', desc: 'App mapping file' method_option :proj, type: :string, aliases: '-P', desc: 'Project id in BugHD.com if upload app mapping file' - method_option :open, type: :boolean, desc: 'true/false if open for everyone, the default is: true', default: true + method_option :open, type: :boolean, desc: 'true/false if open for everyone' method_option :password, type: :string, desc: 'Set password for app' def publish(*args) prepare :publish diff --git a/lib/fir/util/publish.rb b/lib/fir/util/publish.rb index 4cac39a..c775fd9 100644 --- a/lib/fir/util/publish.rb +++ b/lib/fir/util/publish.rb @@ -162,7 +162,7 @@ module FIR @changelog = read_changelog(options[:changelog]).to_s.to_utf8 @short = options[:short].to_s @passwd = options[:password].to_s - @is_opened = @passwd.blank? ? !!options[:open] : false + @is_opened = @passwd.blank? ? options[:open] : false @export_qrcode = !!options[:qrcode] end From f1a4f38cbff287d229e6d2ab2dcb4e78872a6de5 Mon Sep 17 00:00:00 2001 From: NaixSpirit Date: Wed, 4 May 2016 11:16:22 +0800 Subject: [PATCH 6/6] version 1.5.0 --- CHANGELOG | 3 +++ fir-cli.gemspec | 2 +- lib/fir/version.rb | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 6a3fc98..42342e8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ ## 更新记录 +### fir-cli 1.5.0 +- 取消 --open 默认值 + ### fir-cli 1.4.9 - 修正 --password 与 --open 冲突的问题 diff --git a/fir-cli.gemspec b/fir-cli.gemspec index c77a2eb..f161bc9 100644 --- a/fir-cli.gemspec +++ b/fir-cli.gemspec @@ -27,7 +27,7 @@ Gem::Specification.new do |spec| /_/ /___/_/ |_| \____/_____/___/ ## 更新记录 - ### fir-cli 1.4.9 + ### fir-cli 1.5.0 - 修正 build 后直接 -p 发布的权限错误 - 增加上传时候设置密码及公开访问权限 - 增加 build_ipa 中的 destination 参数 diff --git a/lib/fir/version.rb b/lib/fir/version.rb index 2eb2e29..ee38bda 100644 --- a/lib/fir/version.rb +++ b/lib/fir/version.rb @@ -1,5 +1,5 @@ # encoding: utf-8 module FIR - VERSION = '1.4.9' + VERSION = '1.5.0' end