Skip to content

Commit

Permalink
need to add auto updating
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitavoloboev committed Aug 13, 2017
1 parent f3d1ce9 commit c02047e
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

// name of background job that checks for updates
const updateJobName = "checkForUpdate"
const repo = "deanishe/alfred-ssh"
const repo = "nikitavoloboev/web-searches"

var (
// kingpin and script
Expand All @@ -38,6 +38,10 @@ var (
wf *aw.Workflow
)

type options struct {
checkForUpdate bool // download list of available releases
}

// sets up kingpin flags
func init() {
wf = aw.NewWorkflow(nil)
Expand Down Expand Up @@ -82,6 +86,21 @@ func filterWebsites(links map[string]string) {
wf.SendFeedback()
}

// TODO: does not work I think
func runUpdate(o *options) {
wf.TextErrors = true

if err := wf.CheckForUpdate(); err != nil {
wf.FatalError(err)
}

if wf.UpdateAvailable() {
log.Printf("[update] An update is available")
} else {
log.Printf("[update] Workflow is up to date")
}
}

func run() {
var err error

Expand Down

0 comments on commit c02047e

Please sign in to comment.