pindo 5.19.4 → 5.19.5
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 +4 -4
- data/lib/pindo/base/git_handler.rb +5 -5
- data/lib/pindo/command/appstore/iap.rb +2 -2
- data/lib/pindo/command/appstore/updateid.rb +1 -1
- data/lib/pindo/command/ios/podpush.rb +1 -1
- data/lib/pindo/command/unity/packbuild.rb +1 -1
- data/lib/pindo/command/utils/copyconfig.rb +1 -1
- data/lib/pindo/command/utils/renewbundleid.rb +1 -1
- data/lib/pindo/config/build_info_manager.rb +2 -2
- data/lib/pindo/module/appstore/itcapp_helper.rb +1 -1
- data/lib/pindo/module/build/swark_helper.rb +1 -1
- data/lib/pindo/module/cert/cert_helper.rb +1 -1
- data/lib/pindo/module/cert/pem_helper.rb +1 -1
- data/lib/pindo/module/pgyer/pgyerhelper.rb +4 -4
- data/lib/pindo/module/task/model/build/ios_build_adhoc_task.rb +1 -1
- data/lib/pindo/module/task/model/build/ios_build_appstore_task.rb +1 -1
- data/lib/pindo/module/task/model/git/git_commit_task.rb +2 -2
- data/lib/pindo/module/utils/git_repo_helper.rb +2 -2
- data/lib/pindo/module/xcode/applovin_xcode_helper.rb +1 -1
- data/lib/pindo/module/xcode/cocoapods_helper.rb +2 -2
- data/lib/pindo/module/xcode/xcode_build_helper.rb +3 -3
- data/lib/pindo/module/xcode/xcode_swark_helper.rb +1 -1
- data/lib/pindo/version.rb +17 -10
- data/lib/pindo.rb +12 -0
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b7cccaa492d62d373f89fd3af414f3536ca43d47a840cc916b2629445cb581e3
|
|
4
|
+
data.tar.gz: 70f7ad8f931126af81fb7bceae2f54b35d1adc4d34b3991cde6b3a6c6422b950
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9ac4563509d172649298ca22c6f1459b2805521c2c0aa226f6ba9dacdb95b287814d92c70b5b747ac0be9f783c929f180d430dc72c179b76b764e65922ce30c2
|
|
7
|
+
data.tar.gz: 8383a7f60e3970a37e7e3311a6f930dfc9fb68ca49fc56c48ba868678739ed6215ea63d5f326b86ee690afb747a98bede384378e163229094c0e9a2b972c7be9
|
|
@@ -443,7 +443,7 @@ module Pindo
|
|
|
443
443
|
return config_repo_dir
|
|
444
444
|
end
|
|
445
445
|
|
|
446
|
-
def git_addpush_repo(path:nil, message:"
|
|
446
|
+
def git_addpush_repo(path:nil, message:"chore(config): 提交配置变更", commit_file_params:nil)
|
|
447
447
|
# gitee.com 仓库自动去除代理;is_gitee_repo? 命令已带 -C,无需 chdir
|
|
448
448
|
if is_gitee_repo?(local_repo_dir: path)
|
|
449
449
|
return without_proxy { git_addpush_repo_impl(path: path, message: message, commit_file_params: commit_file_params) }
|
|
@@ -452,7 +452,7 @@ module Pindo
|
|
|
452
452
|
git_addpush_repo_impl(path: path, message: message, commit_file_params: commit_file_params)
|
|
453
453
|
end
|
|
454
454
|
|
|
455
|
-
def git_addpush_repo_impl(path:nil, message:"
|
|
455
|
+
def git_addpush_repo_impl(path:nil, message:"chore(config): 提交配置变更", commit_file_params:nil)
|
|
456
456
|
current=Dir.pwd
|
|
457
457
|
Dir.chdir(path)
|
|
458
458
|
begin
|
|
@@ -467,7 +467,7 @@ module Pindo
|
|
|
467
467
|
end
|
|
468
468
|
end
|
|
469
469
|
if need_commit
|
|
470
|
-
git! ['commit', '-m
|
|
470
|
+
git! ['commit', '-m', message]
|
|
471
471
|
git! ['push']
|
|
472
472
|
else
|
|
473
473
|
# puts "\n#{path}\n!!!仓库中文件未发生变化,无需提交!!!\n"
|
|
@@ -478,7 +478,7 @@ module Pindo
|
|
|
478
478
|
# puts files_list
|
|
479
479
|
if !files_list.nil? && files_list.size > 0
|
|
480
480
|
git! ['add', '-A']
|
|
481
|
-
git! ['commit', '-m
|
|
481
|
+
git! ['commit', '-m', message]
|
|
482
482
|
git! ['push']
|
|
483
483
|
else
|
|
484
484
|
puts "\n#{path}\n!!!仓库中文件未发生变化,无需提交!!!\n"
|
|
@@ -620,7 +620,7 @@ module Pindo
|
|
|
620
620
|
|
|
621
621
|
def handle_commit_all(project_dir, branch, commit_message = nil)
|
|
622
622
|
# 使用传入的 commit_message,如果没有则使用默认值
|
|
623
|
-
message = commit_message || "build: 构建产生提交"
|
|
623
|
+
message = commit_message || "chore(build): 构建产生提交"
|
|
624
624
|
|
|
625
625
|
Funlog.instance.fancyinfo_start("开始提交文件...")
|
|
626
626
|
git! ['add', '-A']
|
|
@@ -150,7 +150,7 @@ module Pindo
|
|
|
150
150
|
|
|
151
151
|
pindo_dir = File.expand_path(pindo_single_config.pindo_dir)
|
|
152
152
|
config_repo_dir = File.join(pindo_dir, @bundle_id)
|
|
153
|
-
Pindo::GitHandler.git_addpush_repo(path: config_repo_dir, message: "
|
|
153
|
+
Pindo::GitHandler.git_addpush_repo(path: config_repo_dir, message: "chore(config): 下载应用 iap 配置", commit_file_params: ["fastlane/iap/iap_appstore_download.json"])
|
|
154
154
|
|
|
155
155
|
update_app_share_secrets(app_id: app_id, need_create: false)
|
|
156
156
|
end
|
|
@@ -295,7 +295,7 @@ module Pindo
|
|
|
295
295
|
file.close
|
|
296
296
|
end
|
|
297
297
|
|
|
298
|
-
Pindo::GitHandler.git_addpush_repo(path: config_repo_dir, message: "
|
|
298
|
+
Pindo::GitHandler.git_addpush_repo(path: config_repo_dir, message: "chore(config): 更新应用 shared secret", commit_file_params: ["config.json"])
|
|
299
299
|
|
|
300
300
|
end
|
|
301
301
|
|
|
@@ -211,7 +211,7 @@ module Pindo
|
|
|
211
211
|
# 只提交 config.json 到 Git 仓库
|
|
212
212
|
Pindo::GitHandler.git_addpush_repo(
|
|
213
213
|
path: app_config_dir,
|
|
214
|
-
message: "
|
|
214
|
+
message: "chore(config): 同步 Apple Developer Portal 的 capabilities",
|
|
215
215
|
commit_file_params: ["config.json"]
|
|
216
216
|
)
|
|
217
217
|
|
|
@@ -270,7 +270,7 @@ module Pindo
|
|
|
270
270
|
begin FileUtils.mkdir_p(dest_dir) rescue StandardError => e end
|
|
271
271
|
FileUtils.cp_r(podspec, File.join(dest_dir, File.basename(podspec)))
|
|
272
272
|
puts "上传到仓库 #{private_source.repo}"
|
|
273
|
-
git_addpush_repo(path:private_source.repo, message:"
|
|
273
|
+
git_addpush_repo(path:private_source.repo, message:"chore(pod): 添加 #{pod_name} #{tag_name}")
|
|
274
274
|
end
|
|
275
275
|
end
|
|
276
276
|
|
|
@@ -188,7 +188,7 @@ module Pindo
|
|
|
188
188
|
tag_type: @args_tag_type,
|
|
189
189
|
tag_pre: @args_tag_pre,
|
|
190
190
|
process_type: process_type,
|
|
191
|
-
commit_message: "chore:
|
|
191
|
+
commit_message: "chore(nuget): 更新 nuget v#{confirmed_version} Release Notes",
|
|
192
192
|
fixed_version: confirmed_version # 传入确认后的版本号
|
|
193
193
|
)
|
|
194
194
|
tasks << git_commit_task
|
|
@@ -184,7 +184,7 @@ module Pindo
|
|
|
184
184
|
# 提交到 Git 仓库
|
|
185
185
|
Pindo::GitHandler.git_addpush_repo(
|
|
186
186
|
path: app_config_dir,
|
|
187
|
-
message: "
|
|
187
|
+
message: "chore(config): 同步 Apple Developer Portal 的 capabilities",
|
|
188
188
|
commit_file_params: ["config.json"]
|
|
189
189
|
)
|
|
190
190
|
|
|
@@ -220,7 +220,7 @@ module Pindo
|
|
|
220
220
|
f.write(JSON.pretty_generate(git_repo_json))
|
|
221
221
|
end
|
|
222
222
|
|
|
223
|
-
Pindo::GitHandler.git_addpush_repo(path: pindo_setting_dir, message: "
|
|
223
|
+
Pindo::GitHandler.git_addpush_repo(path: pindo_setting_dir, message: "chore(config): 添加 #{repo_name} 仓库")
|
|
224
224
|
end
|
|
225
225
|
|
|
226
226
|
# 更新应用配置仓库(从模板复制)
|
|
@@ -252,7 +252,7 @@ module Pindo
|
|
|
252
252
|
end
|
|
253
253
|
|
|
254
254
|
# 提交并推送到远程仓库
|
|
255
|
-
Pindo::GitHandler.git_addpush_repo(path: app_config_dir, message: "
|
|
255
|
+
Pindo::GitHandler.git_addpush_repo(path: app_config_dir, message: "chore(config): 初始化应用配置")
|
|
256
256
|
end
|
|
257
257
|
end
|
|
258
258
|
|
|
@@ -186,7 +186,7 @@ module Pindo
|
|
|
186
186
|
if File.exist?(app_config_file)
|
|
187
187
|
modify_appconfig_file(config_file: app_config_file, app_info_detail: app)
|
|
188
188
|
Pindo::GitHandler.prepare_gitenv()
|
|
189
|
-
Pindo::GitHandler.git_addpush_repo(path: app_config_dir, message: "
|
|
189
|
+
Pindo::GitHandler.git_addpush_repo(path: app_config_dir, message: "chore(config): 修改 apple id")
|
|
190
190
|
end
|
|
191
191
|
rescue StandardError => e
|
|
192
192
|
puts "更新远程配置仓库失败: #{e.message}"
|
|
@@ -127,7 +127,7 @@ module Pindo
|
|
|
127
127
|
f.write(JSON.pretty_generate(swark_authorize_json))
|
|
128
128
|
end
|
|
129
129
|
|
|
130
|
-
Pindo::GitHandler.git_addpush_repo(path: app_config_dir, message: "
|
|
130
|
+
Pindo::GitHandler.git_addpush_repo(path: app_config_dir, message: "chore(config): 添加 swark 授权配置")
|
|
131
131
|
end
|
|
132
132
|
|
|
133
133
|
end
|
|
@@ -143,7 +143,7 @@ module Pindo
|
|
|
143
143
|
|
|
144
144
|
# 提交并推送到远程仓库
|
|
145
145
|
Pindo::GitHandler.prepare_gitenv()
|
|
146
|
-
Pindo::GitHandler.git_addpush_repo(path: cert_repo_dir, message: "
|
|
146
|
+
Pindo::GitHandler.git_addpush_repo(path: cert_repo_dir, message: "chore(cert): 删除 #{apple_id} 的证书")
|
|
147
147
|
|
|
148
148
|
puts "✓ Git 仓库证书清理完成"
|
|
149
149
|
end
|
|
@@ -65,7 +65,7 @@ module Pindo
|
|
|
65
65
|
FileUtils.cp_r(File.join(push_path, "."), push_repo_dir)
|
|
66
66
|
|
|
67
67
|
Pindo::GitHandler.prepare_gitenv()
|
|
68
|
-
Pindo::GitHandler.git_addpush_repo(path: app_config_dir, message: "
|
|
68
|
+
Pindo::GitHandler.git_addpush_repo(path: app_config_dir, message: "chore(cert): 添加推送证书")
|
|
69
69
|
|
|
70
70
|
puts "✓ 证书已上传到配置仓库: #{push_repo_dir}"
|
|
71
71
|
end
|
|
@@ -432,7 +432,7 @@ module Pindo
|
|
|
432
432
|
|
|
433
433
|
# 确保已登录
|
|
434
434
|
unless login
|
|
435
|
-
raise Informative, "
|
|
435
|
+
raise Informative, "JPS 未登录或登录已失效,请执行 pindo jps login 重新登录"
|
|
436
436
|
end
|
|
437
437
|
|
|
438
438
|
# 获取 app_info_obj
|
|
@@ -506,7 +506,7 @@ module Pindo
|
|
|
506
506
|
end
|
|
507
507
|
|
|
508
508
|
unless login
|
|
509
|
-
raise Informative, "
|
|
509
|
+
raise Informative, "JPS 未登录或登录已失效,请执行 pindo jps login 重新登录"
|
|
510
510
|
end
|
|
511
511
|
|
|
512
512
|
puts "[PINDO_DEBUG] 正在查找项目: #{config_result[:project_name]}" if ENV['PINDO_DEBUG']
|
|
@@ -686,7 +686,7 @@ module Pindo
|
|
|
686
686
|
|
|
687
687
|
|
|
688
688
|
else
|
|
689
|
-
raise Informative, "
|
|
689
|
+
raise Informative, "JPS 未登录或登录已失效,请执行 pindo jps login 重新登录"
|
|
690
690
|
end
|
|
691
691
|
@proj_name = upload_proj_name
|
|
692
692
|
app_info_obj
|
|
@@ -1460,7 +1460,7 @@ module Pindo
|
|
|
1460
1460
|
|
|
1461
1461
|
if app_info_list.nil?
|
|
1462
1462
|
Funlog.instance.fancyinfo_error("拉取app信息列表失败!")
|
|
1463
|
-
raise Informative, "JPS网络数据异常,请检查网络连接或重新登录(pindo
|
|
1463
|
+
raise Informative, "JPS网络数据异常,请检查网络连接或重新登录(pindo jps login)"
|
|
1464
1464
|
end
|
|
1465
1465
|
|
|
1466
1466
|
return app_info_list
|
|
@@ -200,7 +200,7 @@ module Pindo
|
|
|
200
200
|
git_helper = Pindo::GitRepoHelper.share_instance
|
|
201
201
|
git_helper.git_addpush_repo(
|
|
202
202
|
path: app_config_repo_dir,
|
|
203
|
-
message: "
|
|
203
|
+
message: "chore(config): 递增 build number",
|
|
204
204
|
commit_file_params: ["config.json"]
|
|
205
205
|
)
|
|
206
206
|
end
|
|
@@ -173,7 +173,7 @@ module Pindo
|
|
|
173
173
|
git_helper = Pindo::GitRepoHelper.share_instance
|
|
174
174
|
git_helper.git_addpush_repo(
|
|
175
175
|
path: app_config_repo_dir,
|
|
176
|
-
message: "
|
|
176
|
+
message: "chore(config): 递增 build number",
|
|
177
177
|
commit_file_params: ["config.json"]
|
|
178
178
|
)
|
|
179
179
|
end
|
|
@@ -27,7 +27,7 @@ module Pindo
|
|
|
27
27
|
# - tag_pre: tag前缀,默认 'v'
|
|
28
28
|
# - fixed_version: 外部指定的固定版本号
|
|
29
29
|
# - process_type: 未提交文件的处理方式 ('skip', 'commit', 'reset', 'stash'),默认 'skip'
|
|
30
|
-
# - commit_message: 提交消息,默认 'build: 构建产生提交'
|
|
30
|
+
# - commit_message: 提交消息,默认 'chore(build): 构建产生提交'
|
|
31
31
|
#
|
|
32
32
|
# 版本号计算逻辑:
|
|
33
33
|
# 1. 如果 fixed_version 为 nil 且 HEAD 存在 tag 且工作目录干净,
|
|
@@ -38,7 +38,7 @@ module Pindo
|
|
|
38
38
|
# GitCommitTask 特有的属性
|
|
39
39
|
@fixed_version = options[:fixed_version] # 外部指定的固定版本号
|
|
40
40
|
@process_type = options[:process_type] || Pindo::UncommittedFilesProcessType::SKIP_WITH_TAG # 默认跳过但打tag
|
|
41
|
-
@commit_message = options[:commit_message] || 'build: 构建产生提交' # 默认提交消息
|
|
41
|
+
@commit_message = options[:commit_message] || 'chore(build): 构建产生提交' # 默认提交消息
|
|
42
42
|
|
|
43
43
|
options[:project_path] = project_path
|
|
44
44
|
# 调用基类初始化(基类会设置 release_branch, ver_inc, tag_type, tag_pre 等通用属性)
|
|
@@ -57,7 +57,7 @@ module Pindo
|
|
|
57
57
|
current_branch = Pindo::GitHandler.git!(%W(-C #{current_git_root_path} rev-parse --abbrev-ref HEAD)).strip
|
|
58
58
|
Pindo::GitHandler.git!(%W(-C #{current_git_root_path} add cliff.toml))
|
|
59
59
|
# .gitignore 已由 check_gitignore 自动添加到暂存区,无需重复添加
|
|
60
|
-
commit_message = "docs: 添加日志变更配置".encode('UTF-8')
|
|
60
|
+
commit_message = "docs(config): 添加日志变更配置".encode('UTF-8')
|
|
61
61
|
Pindo::GitHandler.git!(%W(-C #{current_git_root_path} commit -m #{commit_message}))
|
|
62
62
|
Pindo::GitHandler.git!(%W(-C #{current_git_root_path} push origin #{current_branch}))
|
|
63
63
|
else
|
|
@@ -158,7 +158,7 @@ module Pindo
|
|
|
158
158
|
current_branch = Pindo::GitHandler.git!(%W(-C #{git_root_dir} rev-parse --abbrev-ref HEAD)).strip
|
|
159
159
|
|
|
160
160
|
# 提交
|
|
161
|
-
commit_message = "chore: 更新 .gitignore 规则"
|
|
161
|
+
commit_message = "chore(config): 更新 .gitignore 规则"
|
|
162
162
|
Pindo::GitHandler.git!(%W(-C #{git_root_dir} commit -m #{commit_message}))
|
|
163
163
|
Funlog.instance.fancyinfo_success("已自动提交 .gitignore 更改")
|
|
164
164
|
|
|
@@ -230,7 +230,7 @@ module Pindo
|
|
|
230
230
|
begin
|
|
231
231
|
Pindo::GitHandler.git_addpush_repo(
|
|
232
232
|
path: config_dir,
|
|
233
|
-
message: "Applovin SKAdNetworkItems",
|
|
233
|
+
message: "chore(config): 更新 Applovin SKAdNetworkItems",
|
|
234
234
|
commit_file_params: ["applovin_client_config.json"]
|
|
235
235
|
)
|
|
236
236
|
puts "✓ 配置已保存到远程仓库"
|
|
@@ -187,7 +187,7 @@ module Pindo
|
|
|
187
187
|
FileUtils.cp(proj_pod_file, File.join(app_config_dir, "Podfile.lock"))
|
|
188
188
|
Pindo::GitHandler.git_addpush_repo(
|
|
189
189
|
path: app_config_dir,
|
|
190
|
-
message: "#{app_version}
|
|
190
|
+
message: "chore(pod): 备份 #{app_version} 的 Podfile.lock",
|
|
191
191
|
commit_file_params: ["Podfile.lock"]
|
|
192
192
|
)
|
|
193
193
|
|
|
@@ -218,7 +218,7 @@ module Pindo
|
|
|
218
218
|
|
|
219
219
|
Pindo::GitHandler.git_addpush_repo(
|
|
220
220
|
path: app_config_dir,
|
|
221
|
-
message: "
|
|
221
|
+
message: "chore(build): 备份 #{app_version} 的构建输出信息",
|
|
222
222
|
commit_file_params: ["build_verify.json"]
|
|
223
223
|
)
|
|
224
224
|
|
|
@@ -48,7 +48,7 @@ module Pindo
|
|
|
48
48
|
file.close
|
|
49
49
|
end
|
|
50
50
|
|
|
51
|
-
git_addpush_repo(path:app_config_dir, message:"
|
|
51
|
+
git_addpush_repo(path:app_config_dir, message:"chore(build): 回写发布信息", commit_file_params:["build_verify.json"])
|
|
52
52
|
|
|
53
53
|
if File.exist?(src_pod_file)
|
|
54
54
|
FileUtils.cp_r(src_pod_file, File.join(project_dir, "Podfile.lock"))
|
|
@@ -64,7 +64,7 @@ module Pindo
|
|
|
64
64
|
begin
|
|
65
65
|
proj_pod_file = File.join(project_dir, "Podfile.lock")
|
|
66
66
|
FileUtils.cp_r(proj_pod_file, File.join(app_config_dir, "Podfile.lock"))
|
|
67
|
-
git_addpush_repo(path:app_config_dir, message:"#{appversion}
|
|
67
|
+
git_addpush_repo(path:app_config_dir, message:"chore(pod): 备份 #{appversion} 的 Podfile.lock", commit_file_params:["Podfile.lock"])
|
|
68
68
|
|
|
69
69
|
bytes = File.binread(proj_pod_file)
|
|
70
70
|
checksum = Digest::MD5.hexdigest(bytes)
|
|
@@ -84,7 +84,7 @@ module Pindo
|
|
|
84
84
|
file.write(JSON.pretty_generate(build_verify_json))
|
|
85
85
|
file.close
|
|
86
86
|
end
|
|
87
|
-
git_addpush_repo(path:app_config_dir, message:"
|
|
87
|
+
git_addpush_repo(path:app_config_dir, message:"chore(build): 备份 #{appversion} 的构建输出信息", commit_file_params:["build_verify.json"])
|
|
88
88
|
|
|
89
89
|
rescue => error
|
|
90
90
|
raise Informative, "保存Podfile.lock 文件失败!!!"
|
|
@@ -333,7 +333,7 @@ module Pindo
|
|
|
333
333
|
end
|
|
334
334
|
|
|
335
335
|
# 提交到配置仓库
|
|
336
|
-
Pindo::GitHandler.git_addpush_repo(path: app_config_dir, message: "
|
|
336
|
+
Pindo::GitHandler.git_addpush_repo(path: app_config_dir, message: "chore(config): 完成 swark 授权")
|
|
337
337
|
|
|
338
338
|
Funlog.instance.fancyinfo_success("Swark 授权完成!")
|
|
339
339
|
return true
|
data/lib/pindo/version.rb
CHANGED
|
@@ -6,7 +6,7 @@ require 'time'
|
|
|
6
6
|
|
|
7
7
|
module Pindo
|
|
8
8
|
|
|
9
|
-
VERSION = "5.19.
|
|
9
|
+
VERSION = "5.19.5"
|
|
10
10
|
|
|
11
11
|
class VersionCheck
|
|
12
12
|
RUBYGEMS_API = 'https://rubygems.org/api/v1/gems/pindo.json'
|
|
@@ -135,7 +135,10 @@ module Pindo
|
|
|
135
135
|
puts "当前pindo版本 #{Pindo::VERSION}"
|
|
136
136
|
puts "最新版本 #{pindo_latest_version}"
|
|
137
137
|
puts "要求最低版本 #{pindo_mini_version}"
|
|
138
|
-
|
|
138
|
+
puts "请使用 gem install pindo 升级!".red
|
|
139
|
+
# 强制升级必须真正中断:用 exit(1)(SystemExit) 绕过上层通用 rescue,
|
|
140
|
+
# 与 RubyGems API 强制升级路径保持一致;可用 PINDO_SKIP_FORCE_UPDATE=1 紧急跳过
|
|
141
|
+
exit(1)
|
|
139
142
|
end
|
|
140
143
|
end
|
|
141
144
|
|
|
@@ -187,7 +190,7 @@ module Pindo
|
|
|
187
190
|
# 创建 HTTP 连接,禁用代理
|
|
188
191
|
http = Net::HTTP.new(uri.host, uri.port, nil, nil)
|
|
189
192
|
http.use_ssl = true
|
|
190
|
-
http.verify_mode = OpenSSL::SSL::
|
|
193
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_PEER # 校验 SSL 证书(此连接直连 RubyGems、不走代理,公网有效证书可正常校验)
|
|
191
194
|
http.open_timeout = 3 # 3秒超时
|
|
192
195
|
http.read_timeout = 3
|
|
193
196
|
|
|
@@ -535,24 +538,28 @@ module Pindo
|
|
|
535
538
|
current_branch = `git rev-parse --abbrev-ref HEAD`.strip
|
|
536
539
|
current_branch = 'master' if current_branch.empty?
|
|
537
540
|
|
|
538
|
-
#
|
|
539
|
-
system("git fetch origin --quiet")
|
|
541
|
+
# 获取远程更新(数组式 system 避免 shell 注入;失败即抛出,不静默吞掉)
|
|
542
|
+
system("git", "fetch", "origin", "--quiet") or
|
|
543
|
+
raise "git fetch 失败: #{repo_name}"
|
|
540
544
|
|
|
541
545
|
# 强制重置到远程分支最新状态(覆盖本地修改)
|
|
542
|
-
system("git reset --hard origin/#{current_branch} --quiet")
|
|
546
|
+
system("git", "reset", "--hard", "origin/#{current_branch}", "--quiet") or
|
|
547
|
+
raise "git reset 失败: #{repo_name}"
|
|
543
548
|
|
|
544
|
-
#
|
|
545
|
-
system("git branch --set-upstream-to=origin/#{current_branch}
|
|
549
|
+
# 设置上游分支(失败可忽略)
|
|
550
|
+
system("git", "branch", "--set-upstream-to=origin/#{current_branch}", current_branch, "--quiet", err: File::NULL)
|
|
546
551
|
|
|
547
552
|
# 拉取最新更新
|
|
548
|
-
system("git pull --quiet")
|
|
553
|
+
system("git", "pull", "--quiet") or
|
|
554
|
+
raise "git pull 失败: #{repo_name}"
|
|
549
555
|
end
|
|
550
556
|
else
|
|
551
557
|
# 仓库不存在,执行 git clone
|
|
552
558
|
puts " 📦 克隆: #{repo_name}".cyan if ENV['PINDO_DEBUG']
|
|
553
559
|
parent_dir = File.dirname(dir)
|
|
554
560
|
FileUtils.mkdir_p(parent_dir) unless File.exist?(parent_dir)
|
|
555
|
-
system("git clone
|
|
561
|
+
system("git", "clone", url, dir, "--quiet") or
|
|
562
|
+
raise "git clone 失败: #{repo_name} (#{url})"
|
|
556
563
|
end
|
|
557
564
|
end
|
|
558
565
|
end
|
data/lib/pindo.rb
CHANGED
|
@@ -21,6 +21,18 @@ module Pindo
|
|
|
21
21
|
# 解析参数以确定是否是 help 或 version 命令
|
|
22
22
|
coerced_argv = CLAide::ARGV.coerce(argv)
|
|
23
23
|
|
|
24
|
+
# --verbose 等效 PINDO_DEBUG=1:必须在版本检查、参数初始化等任何逻辑之前设置,
|
|
25
|
+
# 否则子命令 initialize 早期执行的调试日志会因 ENV 未就绪而丢失
|
|
26
|
+
ENV['PINDO_DEBUG'] = '1' if coerced_argv.flag?('verbose')
|
|
27
|
+
|
|
28
|
+
# 依赖库 jpsclient 有自己的调试开关 JPS_DEBUG;pindo 处于调试模式时同步打开它。
|
|
29
|
+
# 仅当 PINDO_DEBUG 为真值时才桥接:PINDO_DEBUG=0/false 因 Ruby 字符串恒为真值本会误开,
|
|
30
|
+
# 这里按 jpsclient 的真值规则排除;且不覆盖用户显式设置的 JPS_DEBUG
|
|
31
|
+
pindo_debug_val = ENV['PINDO_DEBUG'].to_s.strip.downcase
|
|
32
|
+
if !pindo_debug_val.empty? && !%w[0 false no].include?(pindo_debug_val) && !ENV['JPS_DEBUG']
|
|
33
|
+
ENV['JPS_DEBUG'] = '1'
|
|
34
|
+
end
|
|
35
|
+
|
|
24
36
|
# 显示欢迎界面(除了 help/version 命令和特定情况)
|
|
25
37
|
show_welcome_banner(argv, coerced_argv)
|
|
26
38
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pindo
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 5.19.
|
|
4
|
+
version: 5.19.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- wade
|
|
@@ -109,20 +109,20 @@ dependencies:
|
|
|
109
109
|
requirements:
|
|
110
110
|
- - "~>"
|
|
111
111
|
- !ruby/object:Gem::Version
|
|
112
|
-
version: '2.
|
|
112
|
+
version: '2.7'
|
|
113
113
|
- - ">="
|
|
114
114
|
- !ruby/object:Gem::Version
|
|
115
|
-
version: 2.
|
|
115
|
+
version: 2.7.0
|
|
116
116
|
type: :runtime
|
|
117
117
|
prerelease: false
|
|
118
118
|
version_requirements: !ruby/object:Gem::Requirement
|
|
119
119
|
requirements:
|
|
120
120
|
- - "~>"
|
|
121
121
|
- !ruby/object:Gem::Version
|
|
122
|
-
version: '2.
|
|
122
|
+
version: '2.7'
|
|
123
123
|
- - ">="
|
|
124
124
|
- !ruby/object:Gem::Version
|
|
125
|
-
version: 2.
|
|
125
|
+
version: 2.7.0
|
|
126
126
|
- !ruby/object:Gem::Dependency
|
|
127
127
|
name: rqrcode
|
|
128
128
|
requirement: !ruby/object:Gem::Requirement
|