fir-cli 1.4.9 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 90ae72f438cf6fd7875108bf55144186b7e1184c
4
- data.tar.gz: d3f2953c56f666afa334469784324953c90b3c96
3
+ metadata.gz: 6d84cfdd014b5dc65bd4221ba4dce498ef0fbc8a
4
+ data.tar.gz: db4b492052e92961c291a6242fe90e89c885af62
5
5
  SHA512:
6
- metadata.gz: 39166292c62f7f4cb9b619953097757fd8283750c506530369dacc59e535eafe8401b192393424e603927c231f30404ad579646c13ff6c10101c017b7ee2f3de
7
- data.tar.gz: 8694694118ab6973cc8049d9a8fdac632743ec64a9822828baa086b010ee48d22333c90f6888a50dce94c2ec47576f11753db4660c62b3e716909da22c753d45
6
+ metadata.gz: 2d6d298a917cddb526f1c88c34ba4f71cbfbab8e77f824ceb7da9a3a2d8a63a3887538755043623cb270ebd3bd78533198f87b457a47a7b2cc539bd755e7b734
7
+ data.tar.gz: 28e45046935d7d156db8ed108d93f3de3e1c8422e9c14339e481a7f3737a33d0e38dc70e3fedf28c45b7a74c7039075148208fec916ac17d52f4ecf6677a3ed7
data/CHANGELOG CHANGED
@@ -1,5 +1,8 @@
1
1
  ## 更新记录
2
2
 
3
+ ### fir-cli 1.5.0
4
+ - 取消 --open 默认值
5
+
3
6
  ### fir-cli 1.4.9
4
7
  - 修正 --password 与 --open 冲突的问题
5
8
 
data/doc/install.md CHANGED
@@ -37,7 +37,7 @@ $ gem install fir-cli
37
37
  gem install fir-cli
38
38
  ```
39
39
 
40
- - Mac OS X 10.11 以后的版本, 由于10.11引入了 `rootless`, 无法直接安装 fir-cli, 有以下三种解决办法:**
40
+ - Mac OS X 10.11 以后的版本, 由于10.11引入了 `rootless`, 无法直接安装 fir-cli, 有以下三种解决办法:
41
41
 
42
42
  1\. 使用 [Homebrew](http://brew.sh/) 及 [RVM](https://rvm.io/) 安装 Ruby, 再安装 fir-cli(推荐)
43
43
 
data/doc/publish.md CHANGED
@@ -13,8 +13,7 @@ Options:
13
13
  -Q, [--qrcode], [--no-qrcode] # Generate qrcode
14
14
  -m, [--mappingfile=MAPPINGFILE] # App mapping file
15
15
  -P, [--proj=PROJ] # Project id in BugHD.com if upload app mapping file
16
- [--open], [--no-open] # true/false if open for everyone, the default is: true
17
- # Default: true
16
+ [--open], [--no-open] # true/false if open for everyone
18
17
  [--password=PASSWORD] # Set password for app
19
18
  -T, [--token=TOKEN] # User's API Token at fir.im
20
19
  -L, [--logfile=LOGFILE] # Path to writable logfile
@@ -31,6 +30,6 @@ Options:
31
30
  - `-Q` 参数, 是否生成发布后二维码, 默认为不生成, 加上 `-Q` 参数后会在当前目录生成一张二维码图片, 扫描该图片即可下载该应用.
32
31
  - `-m` 参数, 上传当前应用的符号表文件, 配合 `-P` 参数使用.
33
32
  - `-P` 参数, [BugHD.com](http://bughd.com) 上相对应的 Project id.
34
- - `--open` 参数, 设置发布后的应用是否开放给所有人下载, 默认为开放, 关闭开放使用 `--no-open` 参数.
33
+ - `--open` 参数, 设置发布后的应用是否开放给所有人下载, 关闭开放使用 `--no-open` 参数.
35
34
  - `--password` 参数, 设置发布后的应用密码
36
35
 
data/fir-cli.gemspec CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
27
27
  /_/ /___/_/ |_| \____/_____/___/
28
28
 
29
29
  ## 更新记录
30
- ### fir-cli 1.4.9
30
+ ### fir-cli 1.5.0
31
31
  - 修正 build 后直接 -p 发布的权限错误
32
32
  - 增加上传时候设置密码及公开访问权限
33
33
  - 增加 build_ipa 中的 destination 参数
data/lib/fir/cli.rb CHANGED
@@ -40,7 +40,7 @@ module FIR
40
40
  method_option :qrcode, type: :boolean, aliases: '-Q', desc: 'Generate qrcode'
41
41
  method_option :mapping, type: :boolean, aliases: '-M', desc: 'true/false if upload app mapping file to BugHD.com'
42
42
  method_option :proj, type: :string, aliases: '-P', desc: 'Project id in BugHD.com if upload app mapping file'
43
- method_option :open, type: :boolean, desc: 'true/false if open for everyone, the default is: true', default: true
43
+ method_option :open, type: :boolean, desc: 'true/false if open for everyone'
44
44
  method_option :password, type: :string, desc: 'Set password for app'
45
45
  def build_ipa(*args)
46
46
  prepare :build_ipa
@@ -106,7 +106,7 @@ module FIR
106
106
  method_option :qrcode, type: :boolean, aliases: '-Q', desc: 'Generate qrcode'
107
107
  method_option :mappingfile, type: :string, aliases: '-m', desc: 'App mapping file'
108
108
  method_option :proj, type: :string, aliases: '-P', desc: 'Project id in BugHD.com if upload app mapping file'
109
- method_option :open, type: :boolean, desc: 'true/false if open for everyone, the default is: true', default: true
109
+ method_option :open, type: :boolean, desc: 'true/false if open for everyone'
110
110
  method_option :password, type: :string, desc: 'Set password for app'
111
111
  def publish(*args)
112
112
  prepare :publish
@@ -47,7 +47,11 @@ module FIR
47
47
  FileUtils.mkdir_p(output_path) unless File.exist?(output_path)
48
48
  output_path
49
49
  else
50
- File.absolute_path(options[:output].to_s)
50
+ output_path = options[:output].to_s
51
+ unless File.exist?(output_path)
52
+ logger.warn "The output path not exist and fir-cli will autocreate it..."
53
+ end
54
+ File.absolute_path(output_path)
51
55
  end
52
56
  end
53
57
 
@@ -3,6 +3,7 @@
3
3
  module FIR
4
4
  module Config
5
5
  CONFIG_PATH = "#{ENV['HOME']}/.fir-cli"
6
+ APP_INFO_PATH = "#{ENV['HOME']}/.fir-cli-app"
6
7
  API_YML_PATH = File.expand_path('../../', __FILE__) + '/api.yml'
7
8
  APP_FILE_TYPE = %w(.ipa .apk).freeze
8
9
 
@@ -27,6 +28,10 @@ module FIR
27
28
  File.open(CONFIG_PATH, 'w+') { |f| f << YAML.dump(hash) }
28
29
  end
29
30
 
31
+ def write_app_info(hash)
32
+ File.open(APP_INFO_PATH, 'w+') { |f| f << YAML.dump(hash) }
33
+ end
34
+
30
35
  def current_token
31
36
  @token ||= config[:token] if config
32
37
  end
@@ -31,7 +31,11 @@ module FIR
31
31
 
32
32
  # @apk.icon is a hash, { icon_name: icon_binary_data }
33
33
  def tmp_icons
34
- @apk.icon.map { |_, data| generate_tmp_icon(data, :apk) }
34
+ begin
35
+ @apk.icon.map { |_, data| generate_tmp_icon(data, :apk) }
36
+ rescue
37
+ []
38
+ end
35
39
  end
36
40
  end
37
41
  end
@@ -40,6 +40,7 @@ module FIR
40
40
  upload_app_binary
41
41
  upload_device_info
42
42
  update_app_info
43
+ fetch_app_info
43
44
  end
44
45
 
45
46
  def upload_app_icon
@@ -123,7 +124,9 @@ module FIR
123
124
  def fetch_app_info
124
125
  logger.info 'Fetch app info from fir.im'
125
126
 
126
- get fir_api[:app_url] + "/#{@app_id}", api_token: @token
127
+ @fir_app_info = get(fir_api[:app_url] + "/#{@app_id}", api_token: @token)
128
+ write_app_info(id: @fir_app_info[:id], short: @fir_app_info[:short], name: @fir_app_info[:name])
129
+ @fir_app_info
127
130
  end
128
131
 
129
132
  def upload_mapping_file_with_publish(options)
@@ -138,7 +141,7 @@ module FIR
138
141
  end
139
142
 
140
143
  def logger_info_app_short_and_qrcode
141
- short = "#{fir_api[:domain]}/#{fetch_app_info[:short]}"
144
+ short = "#{fir_api[:domain]}/#{@fir_app_info[:short]}"
142
145
 
143
146
  logger.info "Published succeed: #{short}"
144
147
 
@@ -159,7 +162,7 @@ module FIR
159
162
  @changelog = read_changelog(options[:changelog]).to_s.to_utf8
160
163
  @short = options[:short].to_s
161
164
  @passwd = options[:password].to_s
162
- @is_opened = @passwd.blank? ? !!options[:open] : false
165
+ @is_opened = @passwd.blank? ? options[:open] : false
163
166
  @export_qrcode = !!options[:qrcode]
164
167
  end
165
168
 
data/lib/fir/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module FIR
4
- VERSION = '1.4.9'
4
+ VERSION = '1.5.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fir-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.9
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - NaixSpirit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-09 00:00:00.000000000 Z
11
+ date: 2016-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -215,7 +215,7 @@ metadata: {}
215
215
  post_install_message: "\n ______________ ________ ____\n /
216
216
  ____/ _/ __ \\ / ____/ / / _/\n / /_ / // /_/ /_____/ / / / /
217
217
  /\n / __/ _/ // _, _/_____/ /___/ /____/ /\n /_/ /___/_/ |_| \\____/_____/___/\n\n
218
- \ ## 更新记录\n ### fir-cli 1.4.9\n - 修正 build 后直接 -p 发布的权限错误\n - 增加上传时候设置密码及公开访问权限\n
218
+ \ ## 更新记录\n ### fir-cli 1.5.0\n - 修正 build 后直接 -p 发布的权限错误\n - 增加上传时候设置密码及公开访问权限\n
219
219
  \ - 增加 build_ipa 中的 destination 参数\n - 详细更新记录, 请查看: https://github.com/FIRHQ/fir-cli/blob/master/CHANGELOG\n
220
220
  \ - [fir-cli](https://github.com/FIRHQ/fir-cli) 已经开源\n - 欢迎 fork, issue 和 pull
221
221
  request\n "