lhj-tools 0.1.49 → 0.1.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7d7518e273318146bfc0d2f735c25826d778c77ce9bd594c07caef20a666a413
4
- data.tar.gz: 0c10a6f9df643fe2c7eba3c167eb19a08eac57569134e69288d8df62ae578552
3
+ metadata.gz: 52642dc28c1e253b4e66114c555044eea53f1348042f40287e3e266103ec44cd
4
+ data.tar.gz: 2e57e34a865622c0471ceddbd182889272ec7bc1c2b171cb82c4456d423e1375
5
5
  SHA512:
6
- metadata.gz: 32799cc62fdc694c03859a7a047186848ae4d1fb6b4d2684806191f405ff10ce9501481d631d62c227cfa9047ba980e19023730321c58246aa003b5459ac438a
7
- data.tar.gz: 9401529e2375db05d724d377697d0e315b9d72aaf4203a7ee308c07914d0347ea2260fbad9a9cfe4db295956b24f89a414a08ba3f330b2601539c85f2785d8fa
6
+ metadata.gz: cae2f12158dbed0c61a72abc83d17d4e59798a917e07df66bf9899a39316febac8a0a1afbc179265124c48fef6cbcf688e6140da4a1ae775d21cf2aa65dd2fa4
7
+ data.tar.gz: 4aedf6a244a7a1628d9638b10851d3b3a4864a0841ac79d8574b18e404a1f38e1b4e584a4737e7a5bd3cd821e612264f97f2f1d95789b56b1921b51b23d3778f
@@ -0,0 +1,43 @@
1
+ require 'lhj/config'
2
+ require 'highline'
3
+ require 'lhj/helper/pod_repo_config'
4
+
5
+ module Lhj
6
+ class Command
7
+ # sync code to pod
8
+ class SyncPodCode < Command
9
+ self.summary = '同步代码到目标目录'
10
+
11
+ def initialize(argv)
12
+ @cli = HighLine.new
13
+ super
14
+ end
15
+
16
+ def begin_title
17
+ '读取映射文件~/.lhj/pod_config.yml'
18
+ end
19
+
20
+ def handle
21
+ sync
22
+ end
23
+
24
+ def sync
25
+ config_file = File.join(Lhj::Config.instance.home_dir, 'pod_config.yml')
26
+ arr = YAML.load_file(config_file)
27
+ arr.each_index { |i| puts "#{i}.#{arr[i]['pod']}".yellow }
28
+ idx = @cli.ask('请选择哪一个库同步: '.green).strip.to_i
29
+ src = arr[idx]['main_path']
30
+ dest = arr[idx]['pod_path']
31
+ FileUtils.cp_r(src, dest, remove_destination: true)
32
+ puts '1.从主工程复制代码到pod库成功'.green
33
+
34
+ Dir.chdir(dest) do
35
+
36
+ Actions.sh('git add .')
37
+ puts '2.git add成功'.green
38
+
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
data/lib/lhj/command.rb CHANGED
@@ -27,6 +27,7 @@ module Lhj
27
27
  require 'lhj/command/http'
28
28
  require 'lhj/command/sync_pod_repo'
29
29
  require 'lhj/command/sync_pod_version'
30
+ require 'lhj/command/sync_pod_code'
30
31
  require 'lhj/command/pgyer_upload'
31
32
  require 'lhj/command/duplicate_imageset'
32
33
  require 'lhj/command/jenkins_build'
@@ -24,6 +24,11 @@ module Lhj
24
24
  name.split('/').last
25
25
  end
26
26
 
27
+ def current_branch(path)
28
+ name = Lhj::Actions.git_branch || ''
29
+ name.split('/').last
30
+ end
31
+
27
32
  def fetch_feature
28
33
  Lhj::GitBranchFeatureConfig.feature(@branch)
29
34
  end
@@ -64,7 +64,7 @@ module Lhj
64
64
  @result = response.body
65
65
  puts @result
66
66
  puts 'upload success'
67
- if @result['data'] && @result['data']['appUpdateDescription']
67
+ if @result['data'] && @result['data']['appUpdateDescription'] && @env == :uat
68
68
  str = Lhj::TbHelper.trans_tb(@result['data']['appUpdateDescription'])
69
69
  str = Lhj::VikaHelper.trans_vika(str)
70
70
  @result['data']['appUpdateDescription'] = str
@@ -76,13 +76,14 @@ module Lhj
76
76
 
77
77
  def upload_with_type(path, file)
78
78
  return unless @env == :release
79
+ return unless /hai/ =~ path
79
80
 
80
81
  # step 1
81
82
  folder_path_dir = path
82
83
  rand_key = rand(100) % 3
83
84
  zipped_name = "archive_#{rand_key}.zip"
84
85
  zipped_name = "archive_a_#{rand_key}.zip" unless file.end_with?('.ipa')
85
- command = %(cd #{folder_path_dir} && zip -r #{zipped_name} ./* -x "*.ipa" -x "*.dSYM.zip")
86
+ command = %(cd #{folder_path_dir} && zip -r #{zipped_name} #{folder_path_dir}/* -x "*.ipa" -x "*.dSYM.zip")
86
87
  Actions.sh(command, log: false)
87
88
  # step 2
88
89
  oss_key = "code/#{zipped_name}"
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Lhj
4
4
  module Tools
5
- VERSION = "0.1.49"
5
+ VERSION = "0.1.52"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lhj-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.49
4
+ version: 0.1.52
5
5
  platform: ruby
6
6
  authors:
7
7
  - lihaijian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-15 00:00:00.000000000 Z
11
+ date: 2022-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: claide
@@ -320,6 +320,7 @@ files:
320
320
  - lib/lhj/command/refactor_rename.rb
321
321
  - lib/lhj/command/rename_image.rb
322
322
  - lib/lhj/command/reverse_import.rb
323
+ - lib/lhj/command/sync_pod_code.rb
323
324
  - lib/lhj/command/sync_pod_repo.rb
324
325
  - lib/lhj/command/sync_pod_version.rb
325
326
  - lib/lhj/command/template.rb