diff --git a/cmd/scan_run.go b/cmd/scan_run.go index e3ae8a88..ca7d8522 100644 --- a/cmd/scan_run.go +++ b/cmd/scan_run.go @@ -59,7 +59,7 @@ func scanRun(cmd *cobra.Command, args []string) { totalDep := strconv.Itoa(ctx.ScanResult.DependenciesCount) totalVuln := strconv.Itoa(ctx.ScanResult.IssuesCompsCount) t := fmt.Sprint( - "项目扫描成功,依赖数:", + "项目扫描完成,依赖数:", termenv.String(totalDep).Foreground(termenv.ANSIBrightCyan), ",漏洞数:", termenv.String(totalVuln).Foreground(termenv.ANSIBrightRed), diff --git a/inspector/binscan.go b/inspector/binscan.go index 28ee7c11..3c7f4410 100644 --- a/inspector/binscan.go +++ b/inspector/binscan.go @@ -71,7 +71,7 @@ func BinScan(ctx *ScanContext) error { ui.Display(display.MsgError, fmt.Sprint("扫描失败,", e.Error())) return e } else { - ui.Display(display.MsgNotice, fmt.Sprintf("项目扫描成功,依赖数:%d,漏洞数:%d\n", r.DependenciesCount, r.IssuesCompsCount)) + ui.Display(display.MsgNotice, fmt.Sprintf("项目扫描完成,依赖数:%d,漏洞数:%d\n", r.DependenciesCount, r.IssuesCompsCount)) } return nil } diff --git a/module/go_mod/go.go b/module/go_mod/go.go index ccbb3a6c..7326c1f6 100644 --- a/module/go_mod/go.go +++ b/module/go_mod/go.go @@ -42,11 +42,11 @@ func New() base.Inspector { func ScanGoProject(dir string, task *base.ScanTask) ([]base.Module, error) { version, e := execGoVersion() if e != nil { - task.UI.Display(display.MsgError, fmt.Sprintf("【%s】识别到您的环境中 Go 无法正常运行,可能会导致检测结果不完整,访问https://www.murphysec.com/docs/quick-start/language-support/ 了解详情", dir)) + task.UI.Display(display.MsgError, fmt.Sprintf("[%s]识别到您的环境中 Go 无法正常运行,可能会导致检测结果不完整,访问https://www.murphysec.com/docs/quick-start/language-support/ 了解详情", dir)) return nil, ErrGoEnv } if e := execGoModTidy(dir); e != nil { - task.UI.Display(display.MsgError, fmt.Sprintf("【%s】通过 Go获取依赖信息失败,可能会导致检测结果不完整或失败,访问https://www.murphysec.com/docs/quick-start/language-support/ 了解详情", dir)) + task.UI.Display(display.MsgError, fmt.Sprintf("[%s]通过 Go获取依赖信息失败,可能会导致检测结果不完整或失败,访问https://www.murphysec.com/docs/quick-start/language-support/ 了解详情", dir)) logger.Err.Println("go mod tidy execute failed.", e.Error()) return nil, e } diff --git a/module/gradle/gradle.go b/module/gradle/gradle.go index 3eae14f0..34770ed0 100644 --- a/module/gradle/gradle.go +++ b/module/gradle/gradle.go @@ -32,7 +32,7 @@ func (i *Inspector) Inspect(task *base.ScanTask) ([]base.Module, error) { logger.Debug.Println("gradle inspect dir:", dir) info, e := evalGradleInfo(dir) if e != nil { - task.UI.Display(display.MsgError, fmt.Sprintf("【%s】识别到目录下没有 gradlew 文件或您的环境中 Gradle 无法正常运行,可能会导致检测结果不完整,访问https://www.murphysec.com/docs/quick-start/language-support/ 了解详情", dir)) + task.UI.Display(display.MsgError, fmt.Sprintf("[%s]识别到目录下没有 gradlew 文件或您的环境中 Gradle 无法正常运行,可能会导致检测结果不完整,访问https://www.murphysec.com/docs/quick-start/language-support/ 了解详情", dir)) logger.Info.Println("check gradle failed", e.Error()) return nil, e } @@ -54,7 +54,7 @@ func (i *Inspector) Inspect(task *base.ScanTask) ([]base.Module, error) { for _, projectId := range projects { depInfo, e := evalGradleDependencies(dir, projectId, info) if e != nil { - task.UI.Display(display.MsgError, fmt.Sprintf("【%s】通过 Gradle 获取依赖信息失败,可能会导致检测结果不完整或失败,访问https://www.murphysec.com/docs/quick-start/language-support/ 了解详情", dir)) + task.UI.Display(display.MsgError, fmt.Sprintf("[%s]通过 Gradle 获取依赖信息失败,可能会导致检测结果不完整或失败,访问https://www.murphysec.com/docs/quick-start/language-support/ 了解详情", dir)) logger.Info.Println("evalGradleDependencies failed.", projectId, e.Error()) } else { rs = append(rs, depInfo.BaseModule(filepath.Join(dir, "build.gradle"))) diff --git a/module/maven/maven.go b/module/maven/maven.go index f3cb46f2..541ae17a 100644 --- a/module/maven/maven.go +++ b/module/maven/maven.go @@ -31,11 +31,11 @@ func ScanMavenProject(dir string, task *base.ScanTask) ([]base.Module, error) { if doMvnScan { deps, e = scanMvnDependency(dir) if e != nil { - task.UI.Display(display.MsgError, fmt.Sprintf("【%s】通过 Maven获取依赖信息失败,可能会导致检测结果不完整或失败,访问https://www.murphysec.com/docs/quick-start/language-support/ 了解详情", dir)) + task.UI.Display(display.MsgError, fmt.Sprintf("[%s]通过 Maven获取依赖信息失败,可能会导致检测结果不完整或失败,访问https://www.murphysec.com/docs/quick-start/language-support/ 了解详情", dir)) logger.Err.Printf("mvn scan failed: %+v\n", e) } } else { - task.UI.Display(display.MsgError, fmt.Sprintf("【%s】识别到您的环境中 Maven 无法正常运行,可能会导致检测结果不完整,访问https://www.murphysec.com/docs/quick-start/language-support/ 了解详情", dir)) + task.UI.Display(display.MsgError, fmt.Sprintf("[%s]识别到您的环境中 Maven 无法正常运行,可能会导致检测结果不完整,访问https://www.murphysec.com/docs/quick-start/language-support/ 了解详情", dir)) } // analyze pom file {