From 51ec94414baf43fb637aad6ac17c8f60bedd14eb Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Sat, 25 Feb 2017 17:56:23 -0800 Subject: remove weird multi-cmd stuff, single binary with standard go-flags is much easier to understand/maintain --- cmd/nekocrawl.go | 10 ---------- cmd/nekoimport.go | 27 --------------------------- cmd/nekoweb.go | 10 ---------- cmd/util.go | 18 ------------------ 4 files changed, 65 deletions(-) delete mode 100644 cmd/nekocrawl.go delete mode 100644 cmd/nekoimport.go delete mode 100644 cmd/nekoweb.go delete mode 100644 cmd/util.go (limited to 'cmd') diff --git a/cmd/nekocrawl.go b/cmd/nekocrawl.go deleted file mode 100644 index 62a9a1c..0000000 --- a/cmd/nekocrawl.go +++ /dev/null @@ -1,10 +0,0 @@ -package main - -import ( - "adammathes.com/neko/crawler" - _ "adammathes.com/neko/util" -) - -func main() { - crawler.Crawl() -} diff --git a/cmd/nekoimport.go b/cmd/nekoimport.go deleted file mode 100644 index 65f7b8f..0000000 --- a/cmd/nekoimport.go +++ /dev/null @@ -1,27 +0,0 @@ -package main - -import ( - _ "adammathes.com/neko/util" - "adammathes.com/neko/models/feed" - "fmt" - "io/ioutil" - "log" - "os" - "strings" -) - -func main() { - if len(os.Args) < 2 { - fmt.Printf("usage: nekoimport config.json \n\n format is one URL per line\n") - } - - fb, err := ioutil.ReadFile(os.Args[2]) - if err != nil { - log.Fatal("could not read file\n") - } - - feeds := strings.Split(string(fb), "\n") - for _,f := range feeds { - feed.NewFeed(f) - } -} diff --git a/cmd/nekoweb.go b/cmd/nekoweb.go deleted file mode 100644 index 15c6388..0000000 --- a/cmd/nekoweb.go +++ /dev/null @@ -1,10 +0,0 @@ -package main - -import ( - "adammathes.com/neko/web" - _ "adammathes.com/neko/util" -) - -func main() { - web.Serve() -} diff --git a/cmd/util.go b/cmd/util.go deleted file mode 100644 index 59e7b8e..0000000 --- a/cmd/util.go +++ /dev/null @@ -1,18 +0,0 @@ -package util - -import ( - "adammathes.com/neko/config" - "adammathes.com/neko/models" - "os" -) - -var DEFAULT_CONFIG = "config.json" - -func init() { - var configFile = DEFAULT_CONFIG - if len(os.Args) > 1 { - configFile = os.Args[1] - } - config.Read(configFile) - models.InitDB(config.Config.DBServer) -} -- cgit v1.2.3