Skip to content
This repository was archived by the owner on Apr 27, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion toml.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package staert

import (
"fmt"
"os"
"path/filepath"
"strings"
Expand Down Expand Up @@ -34,7 +35,7 @@ func (ts *TomlSource) ConfigFileUsed() string {
func (ts *TomlSource) Parse(cmd *flaeg.Command) (*flaeg.Command, error) {
ts.fullPath = findFile(ts.filename, ts.dirNFullPath)
if len(ts.fullPath) < 2 {
return cmd, nil
return cmd, fmt.Errorf("unable to find config file on disk")
}

metadata, err := toml.DecodeFile(ts.fullPath, cmd.Config)
Expand Down
2 changes: 1 addition & 1 deletion toml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ func TestTomlSource_Parse_FileNotFound(t *testing.T) {
}

command, err := src.Parse(cmd)
require.NoError(t, err)

assert.Error(t, err, "unable to find config file on disk")
assert.Exactly(t, cmd, command)
}

Expand Down