|
@@ -2,7 +2,7 @@ package main
|
|
|
|
|
|
|
|
import (
|
|
import (
|
|
|
"bytes"
|
|
"bytes"
|
|
|
- _ "fmt"
|
|
|
|
|
|
|
+ "fmt"
|
|
|
"log"
|
|
"log"
|
|
|
"os"
|
|
"os"
|
|
|
"os/exec"
|
|
"os/exec"
|
|
@@ -23,19 +23,21 @@ type Repo struct {
|
|
|
var cache map[string]bool
|
|
var cache map[string]bool
|
|
|
var appRoot string
|
|
var appRoot string
|
|
|
var regexes map[string]*regexp.Regexp
|
|
var regexes map[string]*regexp.Regexp
|
|
|
|
|
+var assignRegex *regexp.Regexp
|
|
|
|
|
|
|
|
func init() {
|
|
func init() {
|
|
|
appRoot, _ = os.Getwd()
|
|
appRoot, _ = os.Getwd()
|
|
|
cache = make(map[string]bool)
|
|
cache = make(map[string]bool)
|
|
|
regexes = map[string]*regexp.Regexp{
|
|
regexes = map[string]*regexp.Regexp{
|
|
|
- "github": regexp.MustCompile(`[g|G][i|I][t|T][h|H][u|U][b|B].*[=|:=|:|<-].*\w+.*`),
|
|
|
|
|
- "aws": regexp.MustCompile(`[a|A][w|W][s|S].*[=|:=|:|<-].*\w+.*`),
|
|
|
|
|
- "heroku": regexp.MustCompile(`[h|H][e|E][r|R][o|O][k|K][u|U].*[=|:=|:|<-].*\w+.*`),
|
|
|
|
|
- "facebook": regexp.MustCompile(`[f|F][a|A][c|C][e|E][b|B][o|O][o|O][k|K].*[=|:=|:|<-].*\w+.*`),
|
|
|
|
|
- "twitter": regexp.MustCompile(`[t|T][w|W][i|I][t|T][t|T][e|E][r|R].*[=|:=|:|<-].*\w+.*`),
|
|
|
|
|
- "reddit": regexp.MustCompile(`[r|R][e|E][d|D][d|D][i|I][t|T].*[=|:=|:|<-].*\w+.*`),
|
|
|
|
|
- "twilio": regexp.MustCompile(`[t|T][w|W][i|I][l|L][i|I][o|O].*[=|:=|:|<-].*\w+.*`),
|
|
|
|
|
|
|
+ "github": regexp.MustCompile(`[g|G][i|I][t|T][h|H][u|U][b|B].*(=|:|:=|<-).*\w+.*`),
|
|
|
|
|
+ "aws": regexp.MustCompile(`[a|A][w|W][s|S].*(=|:=|:|<-).*\w+.*`),
|
|
|
|
|
+ "heroku": regexp.MustCompile(`[h|H][e|E][r|R][o|O][k|K][u|U].*(=|:=|:|<-).*\w+.*`),
|
|
|
|
|
+ "facebook": regexp.MustCompile(`[f|F][a|A][c|C][e|E][b|B][o|O][o|O][k|K].*(=|:=|:|<-).*\w+.*`),
|
|
|
|
|
+ "twitter": regexp.MustCompile(`[t|T][w|W][i|I][t|T][t|T][e|E][r|R].*(=|:=|:|<-).*\w+.*`),
|
|
|
|
|
+ "reddit": regexp.MustCompile(`[r|R][e|E][d|D][d|D][i|I][t|T].*(=|:=|:|<-).*\w+.*`),
|
|
|
|
|
+ "twilio": regexp.MustCompile(`[t|T][w|W][i|I][l|L][i|I][o|O].*(=|:=|:|<-).*\w+.*`),
|
|
|
}
|
|
}
|
|
|
|
|
+ assignRegex = regexp.MustCompile(`(=|:|:=|<-)`)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func main() {
|
|
func main() {
|
|
@@ -123,5 +125,5 @@ func diff(commit1 string, commit2 string) {
|
|
|
log.Fatalf("error retrieving commits %v\n", err)
|
|
log.Fatalf("error retrieving commits %v\n", err)
|
|
|
}
|
|
}
|
|
|
cache[commit1+commit2] = true
|
|
cache[commit1+commit2] = true
|
|
|
- checkRegex(string(out))
|
|
|
|
|
|
|
+ fmt.Println(checkRegex(string(out)))
|
|
|
}
|
|
}
|