This commit is contained in:
zricethezav committed 2018-02-18 17:28:36 -06:00
1 parent a77b6e4f8b
commit 5d924ecc53
2 files changed
+6 -4

No files matched your search

+6 -1
View File
@@ -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)
-3
View File
@@ -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)
}