Skip to content

Commit

Permalink
Fix handling of dropped error in test
Browse files Browse the repository at this point in the history
  • Loading branch information
alrs committed Nov 29, 2023
1 parent 9ca889b commit 26a8ec2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions main_test.go
Expand Up @@ -335,12 +335,14 @@ var commonTestScriptsParam = testscript.Params{
var info testInfo
// Read the .ready file's JSON into info.
f, err := os.Open(readyFilename)
if err == nil {
err = json.NewDecoder(f).Decode(&info)
f.Close()
} else {
if err != nil {
ts.Fatalf("failed to open .ready file: %v", err)
}
err = json.NewDecoder(f).Decode(&info)
if err != nil {
ts.Fatalf("error decoding json: %v", err)
}
f.Close()

for i, s := range info.BaseURLs {
ts.Setenv(fmt.Sprintf("HUGOTEST_BASEURL_%d", i), s)
Expand Down

0 comments on commit 26a8ec2

Please sign in to comment.