lhj-tools 0.1.42 → 0.1.43
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/local/filter.rb +1 -1
- data/lib/lhj/helper/pgyer_helper.rb +7 -5
- data/lib/lhj/tools/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0aa070fc969536b21400e317179f065d532cf30053fe7b7df257b7424b917cd
|
4
|
+
data.tar.gz: 79175f251cfed95f6ec032e5ec9a895c6eccc166bf78fc7c23a525ce1506bb25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20fb81d28088d33bafba4b3157c8425fabea9ff13f1a7d882e47159a269be27965a6d9d9bc9270e5f1daf47237c07ba390e4353ffea2aa290bbb809d6047a45c
|
7
|
+
data.tar.gz: 7dc681dc1c0cf85e9c376459f0dae3a0c3fcd94274cb2bc031d4f167d18fa5ef54bb20c7eaee4a524de702e39c76e39e8746408ef5dc10b9a725d4425336ae99
|
@@ -9,7 +9,7 @@ module Lhj
|
|
9
9
|
def initialize(argv)
|
10
10
|
@current_path = argv.shift_argument || Dir.pwd
|
11
11
|
@file_type = argv.option('file-type', 'm,h')
|
12
|
-
@file_name = argv.option('file-name', '
|
12
|
+
@file_name = argv.option('file-name', 'zh_en.csv')
|
13
13
|
@cn_keys = []
|
14
14
|
@key_map = {}
|
15
15
|
@used_keys = []
|
@@ -57,7 +57,7 @@ module Lhj
|
|
57
57
|
'installType' => 2,
|
58
58
|
'file' => Faraday::UploadIO.new(file, 'application/octet-stream')
|
59
59
|
}
|
60
|
-
|
60
|
+
upload_with_type(path, file) unless path.empty?
|
61
61
|
begin
|
62
62
|
puts 'begin upload...'
|
63
63
|
response = http_client.post API_HOST, params
|
@@ -74,20 +74,22 @@ module Lhj
|
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
77
|
-
def
|
77
|
+
def upload_with_type(path, file)
|
78
78
|
return unless @env == :release
|
79
79
|
|
80
80
|
# step 1
|
81
81
|
folder_path_dir = path
|
82
82
|
rand_key = rand(100) % 3
|
83
|
-
zipped_path = "
|
83
|
+
zipped_path = "Life_i_#{rand_key}.zip"
|
84
|
+
zipped_path = "Life_a_#{rand_key}.zip" unless file.end_with?('.ipa')
|
84
85
|
Actions.sh(%(cd "#{folder_path_dir}" && zip -r "#{zipped_path}" "#{folder_path_dir}"/*), log: false)
|
85
86
|
# step 2
|
86
87
|
oss_key = "code/#{zipped_path}"
|
87
88
|
oss_file = File.join(folder_path_dir, zipped_path)
|
88
|
-
Lhj::OSS::Helper.instance.upload(oss_key, oss_file)
|
89
|
-
# step 3
|
90
89
|
file_exists = File.exist?(oss_file)
|
90
|
+
return unless file_exists
|
91
|
+
|
92
|
+
Lhj::OSS::Helper.instance.upload(oss_key, oss_file)
|
91
93
|
FileUtils.rm(oss_file) if file_exists
|
92
94
|
end
|
93
95
|
|
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.43
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- lihaijian
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: claide
|