Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: [cmd] remove bash use #143

Merged
merged 1 commit into from
Sep 10, 2024
Merged

fix: [cmd] remove bash use #143

merged 1 commit into from
Sep 10, 2024

Conversation

starhcq
Copy link
Contributor

@starhcq starhcq commented Sep 10, 2024

remove bash use

Log: remove bash use
Task: https://pms.uniontech.com/task-view-362321.html

@deepin-ci-robot
Copy link

deepin pr auto review

关键摘要:

  • 移除了bash进程的使用,改为使用QStandardPaths::findExecutable来查找可执行文件,这是一个改进,因为bash的调用可能不是跨平台的,并且可能存在安全问题。
  • 移除了QProcess的错误处理和输出处理逻辑,直接返回!path.isEmpty()来判断命令是否存在,这是一个简化,但可能会丢失错误信息。

是否建议立即修改:

  • 是,建议添加错误处理逻辑,以便在命令不存在时提供有用的反馈,而不是仅仅返回false
  • 是,如果QStandardPaths::findExecutable在某些情况下无法正确工作(例如,当命令路径中包含空格或特殊字符时),可能需要重新考虑这个更改。

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: lzwind, starhcq

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@starhcq starhcq merged commit 9ff7f27 into linuxdeepin:master Sep 10, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants