fix: HP插件改用直接执行方式,避免需要.asc签名文件
hp-plugin 命令需要 GPG 签名文件,改用 yes | sh 直接执行更简单 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -337,14 +337,9 @@ def install_script(filepath):
|
|||||||
|
|
||||||
# HP 插件需要特殊处理(非交互式安装)
|
# HP 插件需要特殊处理(非交互式安装)
|
||||||
if 'hplip' in filename and 'plugin' in filename:
|
if 'hplip' in filename and 'plugin' in filename:
|
||||||
# 方法1:尝试使用 hp-plugin 命令安装
|
# 直接执行 .run 文件,使用 yes 自动确认交互式提示
|
||||||
hp_plugin_check = run_command(['which', 'hp-plugin'])
|
# 注意:hp-plugin 命令需要 .asc 签名文件,比较麻烦,所以直接执行
|
||||||
if hp_plugin_check['success']:
|
result = run_command(f'yes | sh {filepath}', shell=True)
|
||||||
result = run_command(f'hp-plugin -i -p {filepath}', shell=True)
|
|
||||||
results.append(('使用 hp-plugin 安装 HP 插件', result))
|
|
||||||
else:
|
|
||||||
# 方法2:使用 yes 命令自动确认交互式提示
|
|
||||||
result = run_command(f'yes | {filepath}', shell=True)
|
|
||||||
results.append(('执行 HP 插件安装脚本', result))
|
results.append(('执行 HP 插件安装脚本', result))
|
||||||
else:
|
else:
|
||||||
# 普通脚本直接执行
|
# 普通脚本直接执行
|
||||||
|
|||||||
Reference in New Issue
Block a user