cocoapods-hooks 0.0.4 → 0.0.5

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: 54b1cae95f9a8281df734d94cb4f40633cf879f94116ad76dae91480fdaa879c
4
+ data.tar.gz: d393b3338821f95ad776805a4a56d3cb439ae5f7a3362aa8fb9bc9f38c7bcfc2
5
5
  SHA512:
6
- metadata.gz: b2500ffcae401c157119d63b19a1b2504af0db0e2c8db50a614df8f79e7184de838026bb60aeb6f35e6b3f7b81d9ee95353f1820741487bc30c814a268fb91ca
7
- data.tar.gz: 1f619feb5d01f64e010cafc646b1bd767cb60932c36567fcff6cf24b2f4e7be449ba1852efaf310db3ffe78509a4b03b7df06ef3682d80b34707fdc703f2b5a1
6
+ metadata.gz: 0152af04ce2300d74bc1ffe0d7eb392da5bc533dce713b582bbf4da206dbca51e2cd79cbfe8579332bdd437235f0aa3c74b545e83627ca0f1387b6a004ad71b9
7
+ data.tar.gz: 155391bb41a176307b13720d704e9bf7b0b56ae65e9bd3c9e3489a945db175a29f7bcfd2de0c1669077f9c63b8aee2ffe305dce329b52bd53e4f13609b8789af
@@ -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,30 +11,36 @@ 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
46
  exist 1
@@ -1,3 +1,3 @@
1
1
  module CocoapodsHooks
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
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.5
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-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler