fir-cli-xsl 2.0.2 → 2.0.3

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: 8470b2eac1f2d31afcd895a595dfdf681b2af502
4
- data.tar.gz: 2be1a84161a970d693858f3fd5041fce4a53e5c0
3
+ metadata.gz: 52432d4ece0aa4efc7f5504151911619771e4514
4
+ data.tar.gz: 2a05e62d515b41df940f499e97f2502f0d7e7f36
5
5
  SHA512:
6
- metadata.gz: 9bbe5b17495cad7f59ea4336398648060e9dbf49a8caa81ca907d15a3a12c99ebbf9f51b83e4d00e70e2396736c410bcd1dc351ee40949ec511ca7abdc676bec
7
- data.tar.gz: a96a8fdbbcc6f6cc37c27b7bf4a7ce4ec7b9c3c8a0e6ae6c478cf81ba0b5ec665230e05125d8f0ac8d9a60834cd247eec87dfe8ddf79d88e9d38e439fbe6d0db
6
+ metadata.gz: e4618e8a988d29876efdb11c69c3861d52e972a74b642add437f5a8c77bf65c9fb4cdfcd1fe75da9b130900849f851d7beaf683501a94d995f8d3f6bb671f160
7
+ data.tar.gz: 526170d7de9c5f5dd754c91eda9994d9cf018023ed3cca93841add0609980bc970bbc59dedbc8df31df09c4d03f315ae8f265fd26f7796ec91f3f75b23e13d43
@@ -37,6 +37,7 @@ Gem::Specification.new do |spec|
37
37
  - [fir-cli](https://github.com/iamjia/fir-cli) 已经开源
38
38
  - 欢迎 fork, issue 和 pull request
39
39
  - xiangshaolong 专用
40
+ - (2.0.3) 鉴于 fir.im 最多只能保留 30 个版本,所以增加了删除同 build 号的其他版本的功能,一个版本只保留一个可追溯的安装包
40
41
  )
41
42
 
42
43
  spec.add_development_dependency 'bundler'
@@ -117,6 +117,7 @@ module FIR
117
117
  method_option :open, type: :boolean, desc: 'true/false if open for everyone'
118
118
  method_option :password, type: :string, desc: 'Set password for app'
119
119
  method_option :dingtalk_notify, type: :boolean, aliases: '-dn', desc: 'enable dingtalk robot notify', default: true
120
+ method_option :delete_latest_version, type: :boolean, aliases: '-dlv', desc: '删除上一个版本'
120
121
 
121
122
  def publish(*args)
122
123
  prepare :publish
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
  module FIR
3
3
  module Publish
4
+
4
5
  def dingtalk(*args, options)
5
6
  if options[:dingtalk_access_token]
6
7
  payload = {
@@ -26,9 +27,45 @@ module FIR
26
27
  # @app_id = '5be4f90f959d69333dd5ab5a'
27
28
 
28
29
  release_info = get(fir_api[:app_url] + "/#{@app_id}" + "/releases", api_token: @token, page: 1)
30
+
31
+ logger.info ">>>> #{@release_info}"
32
+
29
33
  for temp_obj in release_info[:datas]
34
+ logger.info ">>>> #{@release_info}"
30
35
  temp_id = temp_obj[:id]
31
- patch fir_api[:app_url] + "/#{@app_id}" + "/releases" + "/#{temp_id}", api_token: @token, is_history: false
36
+ patch fir_api[:app_url] + "/#{@app_id}" + "/releases" + "/#{temp_id}", api_token: @token, is_history: false
37
+ end
38
+ end
39
+
40
+ def delete_latest_version
41
+ # @file_type = "ipa"
42
+ # @token = options[:token] || current_token
43
+ # # @app_info = {"type": 'ipa', "identifier": 'com.sudiyi.appCourier', "name":'速递易快递', "version":'3.1.1', "build": 'haha'}
44
+ # # @user_info = fetch_user_info(@token)
45
+ # # logger.info ">>>> #{@user_info}"
46
+ # # @uploading_info = fetch_uploading_info
47
+ # # logger.info ">>>> uploading_info #{@uploading_info}"
48
+ # @app_id = '5be4f90f959d69333dd5ab5a'
49
+
50
+ logger.info ">>>> app_info #{@app_info}"
51
+ current_version = @app_info[:version]
52
+ current_build = @app_info[:build]
53
+
54
+ logger.info ">>>> current_version #{current_version}"
55
+ release_info = get(fir_api[:app_url] + "/#{@app_id}" + "/releases", api_token: @token, page: 1)
56
+ for temp_obj in release_info[:datas]
57
+ logger.info ">>>> current_build #{current_build} #{temp_obj[:build]}"
58
+ if temp_obj[:build] == current_build
59
+ next
60
+ end
61
+
62
+ if temp_obj[:version] == current_version
63
+ temp_id = temp_obj[:id]
64
+ api = fir_api[:app_url] + "/#{@app_id}" + "/releases" + "/#{temp_id}"
65
+ logger.info ">>>> app_info #{api} #{@token}"
66
+ RestClient.delete(fir_api[:app_url] + "/#{@app_id}" + "/releases" + "/#{temp_id}", headers={"accesstoken": "c0f6dc8a7d7704d919cbc5d69e6cb2852d1783a1c9"})
67
+ # delete fir_api[:app_url] + "/#{@app_id}" + "/releases" + "/#{temp_id}", accesstoken: 'c0f6dc8a7d7704d919cbc5d69e6cb2852d1783a1c9'
68
+ end
32
69
  end
33
70
  end
34
71
 
@@ -47,9 +84,11 @@ module FIR
47
84
  @uploading_info = fetch_uploading_info
48
85
  @app_id = @uploading_info[:id]
49
86
 
50
- turn_off_history
87
+ # if options[:delete_latest_version]
51
88
  upload_app
52
-
89
+ delete_latest_version
90
+ # turn_off_history
91
+
53
92
  logger_info_dividing_line
54
93
  logger_info_app_short_and_qrcode(options)
55
94
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module FIR
4
- VERSION = '2.0.2'
4
+ VERSION = '2.0.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fir-cli-xsl
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - NaixSpirit
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-11-28 00:00:00.000000000 Z
12
+ date: 2020-01-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -238,7 +238,8 @@ post_install_message: "\n ______________ ________ ____\n
238
238
  (1.7.1) 增加了 钉钉推送 , 增加了返回指定版本下载地址\n - (1.7.0) 过期了ipa_build 功能, 增加了对 android manifest
239
239
  instant run 的兼容\n - (1.6.13) 上传图标逻辑修改\n - (1.6.12) 修复了部分机器没有默认安装 byebug 的问题\n
240
240
  \ - (1.6.11) 变化了 ruby gem 仓库地址\n - [fir-cli](https://github.com/iamjia/fir-cli)
241
- 已经开源\n - 欢迎 fork, issue 和 pull request\n - xiangshaolong 专用\n "
241
+ 已经开源\n - 欢迎 fork, issue 和 pull request\n - xiangshaolong 专用\n - (2.0.3) 鉴于 fir.im
242
+ 最多只能保留 30 个版本,所以增加了删除同 build 号的其他版本的功能,一个版本只保留一个可追溯的安装包\n "
242
243
  rdoc_options: []
243
244
  require_paths:
244
245
  - lib