cocoapods-hooks 0.0.4 → 0.0.6

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
  SHA256:
3
- metadata.gz: 2a8f3c2f76c79d572aa82321a03d139b18a69a552eff8c970003d43ac49d3b6f
4
- data.tar.gz: 25b807ef2e4a47bbf14b5a97a52f1f1227a5fc491595d9d56a632db25f959a1c
3
+ metadata.gz: 72c23779b6eff3a8108ac8b7260aafb259917ff3e0718600d639fa52b88f4c59
4
+ data.tar.gz: 66d30fbe478bf8eb55207415cd62202e34fbdb56083fd9de6888ea548edbbcfd
5
5
  SHA512:
6
- metadata.gz: b2500ffcae401c157119d63b19a1b2504af0db0e2c8db50a614df8f79e7184de838026bb60aeb6f35e6b3f7b81d9ee95353f1820741487bc30c814a268fb91ca
7
- data.tar.gz: 1f619feb5d01f64e010cafc646b1bd767cb60932c36567fcff6cf24b2f4e7be449ba1852efaf310db3ffe78509a4b03b7df06ef3682d80b34707fdc703f2b5a1
6
+ metadata.gz: b4f53d3695229587fda198d2c04e7a0d588ca810c8318a05115d7883053b4e5eee5f6caaa924b4517c11363d1219f7e590bf432d407784c6c22ac35c2ee77b99
7
+ data.tar.gz: 12f1006e56c4ba1ccb697d5aef1759ebcc107b5fee1983341ff39ea7d655511949a423c454f48dbc72abfdf04af98ea361c739cd1d55451d5ce206c876aacbc1
@@ -24,7 +24,7 @@ module Pod
24
24
  result = system("fastlane ios configAllProject")
25
25
  unless result
26
26
  puts "command execution failed. Exiting..."
27
- exist 1
27
+ exit 1
28
28
  end
29
29
  end
30
30
 
@@ -8,34 +8,38 @@ module Pod
8
8
  def self.options
9
9
  [
10
10
  ['--tenantid=TENANTID', 'Specify the tenant ID'],
11
- ['--branch=Branch', 'Specify the branch for git clone']
11
+ ['--version=Version', 'Specify the sdk version for git clone']
12
12
  ].concat(super)
13
13
  end
14
14
 
15
15
  def initialize(argv)
16
16
  @tenantid = argv.option('tenantid')
17
- puts "tenantid is: #{@tenantid}"
18
- @branch = argv.option('branch')
17
+ @version = argv.option('version')
19
18
  super
20
19
  end
21
20
 
22
21
  def validate!
23
22
  super
24
23
  help! 'A tenant ID is required.' unless @tenantid
24
+ help! 'A sdk version is required.' unless @version
25
25
  end
26
26
 
27
27
  def run
28
28
  UI.puts "Downloading OEM configuration for tenant #{@tenantid}"
29
+ if @tenantid.nil? || @tenantid.empty?
30
+ UI.puts "没有传入 tenantid, 直接退出程序"
31
+ exit 1
32
+ end
29
33
  # 执行你的业务逻辑
30
- if @branch == nil
31
- UI.puts "没有传入指定分支,默认使用 main_develop"
32
- @branch = 'main_develop'
34
+ if @version.nil? || @version.empty?
35
+ UI.puts "没有传入指定版本,直接退出程序"
36
+ exit 1
33
37
  end
34
- self.class.git_clone_project_config(@tenantid, @branch)
38
+ self.class.git_clone_project_config(@tenantid, @version)
35
39
  end
36
40
 
37
41
  private
38
- def self.git_clone_project_config(tenant_id, branch)
42
+ def self.git_clone_project_config(tenant_id, version)
39
43
  puts "start download ios project config with tenantid: #{tenant_id}"
40
44
  # 先尝试删除源目录
41
45
  if Dir.exist?('ios_project_config')
@@ -43,7 +47,7 @@ module Pod
43
47
  FileUtils.rm_r('ios_project_config')
44
48
  end
45
49
  ios_project_config_git_url = 'ssh://git@192.168.31.7:7999/ios_module/ios_project_config.git'
46
- success = system("git clone -b #{branch} #{ios_project_config_git_url}")
50
+ success = system("git clone -b #{version} #{ios_project_config_git_url}")
47
51
  puts "当前命令的路径为:#{Dir.pwd}"
48
52
  if success
49
53
  puts "repository cloned to #{Dir.pwd}"
@@ -11,45 +11,51 @@ module Pod
11
11
  def self.options
12
12
  [
13
13
  ['--tenantid=TENANTID', 'Specify the tenant ID'],
14
- ['--branch=Branch', 'Specify the branch for git clone']
14
+ ['--version=Version', 'Specify the sdk version for git clone']
15
15
  ].concat(super)
16
16
  end
17
17
 
18
18
  def initialize(argv)
19
19
  @tenantid = argv.option('tenantid')
20
- @branch = argv.option('branch')
20
+ @version = argv.option('version')
21
21
  super
22
22
  end
23
23
 
24
24
  def validate!
25
25
  super
26
26
  help! 'A tenant ID is required.' unless @tenantid
27
+ help! 'A sdk version is required.' unless @version
27
28
  end
28
29
 
29
30
  def run
30
31
  UI.puts "Downloading OEM configuration for tenant #{@tenantid}"
31
32
  # 执行你的业务逻辑
32
- if @branch == nil
33
- UI.puts "没有传入指定分支,默认使用 main_develop"
34
- @branch = 'main_develop'
33
+ if @tenantid.nil? || @tenantid.empty?
34
+ UI.puts "没有传入 tenantid, 直接退出程序"
35
+ exit 1
36
+ end
37
+ # 执行你的业务逻辑
38
+ if @version.nil? || @version.empty?
39
+ UI.puts "没有传入指定版本,直接退出程序"
40
+ exit 1
35
41
  end
36
42
  # 1. 根据 tenant_id 下载相关的配置文件
37
- result = system("pod git-clone --tenantid=#{@tenantid} --branch=#{@branch}")
43
+ result = system("pod git-clone --tenantid=#{@tenantid} --version=#{@version}")
38
44
  unless result
39
45
  puts "pod git-clone command execution failed. Exiting..."
40
- exist 1
46
+ exit 1
41
47
  end
42
48
  # 2. 修改图片的主题色
43
49
  result = system("pod change-color")
44
50
  unless result
45
51
  puts "pod change-color command execution failed. Exiting..."
46
- exist 1
52
+ exit 1
47
53
  end
48
54
  # 3. 修改工程配置, 进行签名
49
55
  result = system("pod fastlane-sign")
50
56
  unless result
51
57
  puts "pod fastlane-sign command execution failed. Exiting..."
52
- exist 1
58
+ exit 1
53
59
  end
54
60
  end
55
61
  end
@@ -1,3 +1,3 @@
1
1
  module CocoapodsHooks
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-hooks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - huafeng
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-22 00:00:00.000000000 Z
11
+ date: 2023-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler