lhj-tools 0.1.49 → 0.1.52
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lhj/command/sync_pod_code.rb +43 -0
- data/lib/lhj/command.rb +1 -0
- data/lib/lhj/helper/log_helper.rb +5 -0
- data/lib/lhj/helper/pgyer_helper.rb +3 -2
- data/lib/lhj/tools/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52642dc28c1e253b4e66114c555044eea53f1348042f40287e3e266103ec44cd
|
4
|
+
data.tar.gz: 2e57e34a865622c0471ceddbd182889272ec7bc1c2b171cb82c4456d423e1375
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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'
|
@@ -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}
|
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}"
|
data/lib/lhj/tools/version.rb
CHANGED
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.
|
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-
|
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
|