diff --git a/examples/error.feature b/examples/error.feature index 0763c47..1aa5bd5 100644 --- a/examples/error.feature +++ b/examples/error.feature @@ -3,3 +3,8 @@ Feature: Error Given a file named "foo.md" with "" When I run `linkcheck` Then the exit status should be 1 + + Scenario: Fail with a non-existent file + Given a file named "foo.md" with "" + When I run `linkcheck bar.md` + Then the exit status should be 1 diff --git a/main.go b/main.go index fc086d7..d6cdb12 100644 --- a/main.go +++ b/main.go @@ -2,6 +2,7 @@ package main import ( "fmt" + "io/ioutil" "os" docopt "github.com/docopt/docopt-go" @@ -15,7 +16,13 @@ func main() { } }() - getArgs() + args := getArgs() + + _, err := ioutil.ReadFile(args[""].(string)) + + if err != nil { + panic(err) + } } func getArgs() map[string]interface{} {