-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.go
42 lines (37 loc) · 806 Bytes
/
main.go
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
40
41
42
package main
import (
aw "github.com/deanishe/awgo"
"github.com/deanishe/awgo/update"
"log"
)
var (
repo = "chriszarate/alfred-orion-toolkit"
query string
wf *aw.Workflow
)
func init() {
wf = aw.New(update.GitHub(repo), aw.HelpURL(repo+"/issues"))
}
func main() {
wf.Run(run)
}
func run() {
if err := checkForUpdate(); err != nil {
log.Printf("Error starting update check: %s", err)
}
args := wf.Args()
switch args[0] {
case "bookmarks":
if err := searchBookmarks(); err != nil {
log.Fatalf("search failed with %s", err.Error())
}
case "reading-list":
if err := searchReadingList(); err != nil {
log.Fatalf("search failed with %s", err.Error())
}
case "history":
if err := searchHistory(); err != nil {
log.Fatalf("search failed with %s", err.Error())
}
}
}