-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
39 lines (33 loc) · 695 Bytes
/
main.go
File metadata and controls
39 lines (33 loc) · 695 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package main
import (
"fmt"
"log"
"os"
"github.com/juju/gnuflag"
)
func main() {
var email = gnuflag.String("email", "your@email.com", "the email to scan for")
gnuflag.Parse(true)
if *email == "your@email.com" {
var conf = ReadConfig()
email = &conf.Email
}
mydir, err := os.Getwd()
if err != nil {
fmt.Println(err)
}
if gnuflag.NArg() > 0 {
if gnuflag.Arg(0)[0] != '/' && gnuflag.Arg(0)[0] != '~' {
mydir = mydir + "/" + gnuflag.Arg(0)
} else {
mydir = gnuflag.Arg(0)
}
}
directory, err := scan(mydir)
if err != nil {
log.Fatalf(
"no .git folder found, please run this command from a directory with a .git folder",
)
}
stats(*email, directory)
}