fix: remove "bash -c" in command#275
Conversation
|
CLA Assistant Lite bot: |
deepin pr auto review我来对这段代码进行详细的审查和分析:
// 修改前:
content, err := base64.RawStdEncoding.DecodeString(c.Shell)
// 修改后:
shell := strings.TrimRight(c.Shell, "=")
content, err := base64.RawStdEncoding.DecodeString(shell)改进意见:
// 修改前:
logger.Warning("updatePlatform gen token failed", err)
// 修改后:
logger.Warningf("updatePlatform gen token failed: %v", err)改进意见:
// 修改前:
output, err := runcmd.RunnerOutput(60, "bash", hookPath)
// 修改后:
output, err := runcmd.RunnerOutput(60, hookPath)改进意见:
// 修改前:
freeSpace, err := runcmd.RunnerOutput(10, "bash", "-c", "df -l --output=avail / | tail -n 1")
// 修改后:
freeSpace, err := runcmd.RunnerOutput(10, "df", "-l", "--output=avail", "/")改进意见:
// 修改前:
outputStream, err := runcmd.RunnerOutput(10, "bash", "-c", "dpkg -l | tail -n +6 | awk '{print $1,$2,$3}'")
// 修改后:
outputStream, err := runcmd.RunnerOutput(
10,
"dpkg-query",
"-W",
"-f=${db:Status-Abbrev} ${Package} ${Version}\n",
)改进意见:
总体建议:
安全建议:
性能建议:
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: electricface, zhaohuiw42 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Task: https://pms.uniontech.com/task-view-385159.html