Sync script

This commit is contained in:
2015-03-29 00:06:01 +07:00
parent 71f5781c86
commit 86d503d622
3 changed files with 41 additions and 8 deletions
+4
View File
@@ -1,12 +1,16 @@
package main
import (
"flag"
"github.com/localhots/empact/config"
"github.com/localhots/empact/db"
"github.com/localhots/empact/server"
)
func main() {
flag.Parse()
config.Load()
if err := db.Connect(config.C().DatabaseURI); err != nil {
panic(err)
}
+28
View File
@@ -0,0 +1,28 @@
package main
import (
"flag"
"fmt"
"github.com/localhots/empact/config"
"github.com/localhots/empact/db"
"github.com/localhots/empact/task"
)
func main() {
var token string
flag.StringVar(&token, "token", "", "GitHub access token")
flag.Parse()
config.Load()
if token == "" {
fmt.Println("Access token is required")
return
}
if err := db.Connect(config.C().DatabaseURI); err != nil {
panic(err)
}
task.SyncUserOrgs(token)
select {}
}