Skip to content

Commit

Permalink
Quit Application if no results are returned
Browse files Browse the repository at this point in the history
  • Loading branch information
MeNsaaH committed Apr 5, 2020
1 parent 35ac579 commit 987c84f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,15 @@ func ProcessFetchTask(fn fetchFunc) engine.SearchResult {
s.Suffix = " Fetching Data..."
s.Writer = os.Stderr
s.Start()
defer s.Stop()
result = fn()
s.Stop()
} else {
result = fn()
}
if len(result.Movies) <= 0 {
log.Info("No Results Found")
os.Exit(0)
}
return result
}

Expand Down

0 comments on commit 987c84f

Please sign in to comment.