zricethezav преди 8 години
родител
ревизия
5d924ecc53
променени са 2 файла, в които са добавени 6 реда и са изтрити 4 реда
  1. 6 1
      leaks.go
  2. 0 3
      main.go

+ 6 - 1
leaks.go

@@ -21,12 +21,14 @@ type LeakElem struct {
 }
 
 func start(opts *Options) {
+	fmt.Printf("\nEvaluating \x1b[37;1m%s\x1b[0m...\n", opts.RepoURL)
 	c := make(chan os.Signal, 2)
 	signal.Notify(c, os.Interrupt, syscall.SIGTERM)
 
 	err := exec.Command("git", "clone", opts.RepoURL).Run()
 	if err != nil {
-		log.Fatalf("failed to clone repo %v", err)
+		log.Printf("failed to clone repo %v", err)
+		return
 	}
 	repoName := getLocalRepoName(opts.RepoURL)
 	if err = os.Chdir(repoName); err != nil {
@@ -39,6 +41,9 @@ func start(opts *Options) {
 	}()
 
 	report := getLeaks(repoName)
+	if len(report) == 0 {
+		fmt.Printf("No Leaks detected for \x1b[35;2m%s\x1b[0m...\n\n", opts.RepoURL)
+	}
 	cleanup(repoName)
 	reportJSON, _ := json.MarshalIndent(report, "", "\t")
 	err = ioutil.WriteFile(fmt.Sprintf("%s_leaks.json", repoName), reportJSON, 0644)

+ 0 - 3
main.go

@@ -47,10 +47,7 @@ func main() {
 		start(opts)
 	} else if opts.UserURL != "" || opts.OrgURL != "" {
 		repoList := repoScan(opts)
-		fmt.Println(repoList)
 		for _, repo := range repoList {
-			fmt.Println("yoo")
-			fmt.Println(opts.RepoURL)
 			opts.RepoURL = repo.RepoURL
 			start(opts)
 		}