Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Resolve #116] Fix an error message for unsupported Supfile version #117

Merged
merged 2 commits into from Aug 15, 2017
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -146,10 +146,18 @@ type ErrMustUpdate struct {
Msg string
}

type ErrUnsupportedVersion struct {
Msg string
}

func (e ErrMustUpdate) Error() string {
return fmt.Sprintf("%v\n\nPlease update sup by `go get -u github.com/pressly/sup/cmd/sup`", e.Msg)
}

func (e ErrUnsupportedVersion) Error() string {
return fmt.Sprintf("%v\n\nCheck your Supfile version (available versions: 0.{1|2|3|4|5})", e.Msg)

This comment has been minimized.

Copy link
@VojtechVitek

VojtechVitek Aug 15, 2017

Member

can we list the latest version only, ie. v0.5?

}

// NewSupfile parses configuration file and returns Supfile or error.
func NewSupfile(file string) (*Supfile, error) {
var conf Supfile
@@ -213,7 +221,7 @@ func NewSupfile(file string) (*Supfile, error) {
case "0.4", "0.5":

default:
return nil, ErrMustUpdate{"unsupported version " + conf.Version}
return nil, ErrUnsupportedVersion{"unsupported version " + conf.Version}

This comment has been minimized.

Copy link
@VojtechVitek

VojtechVitek Aug 15, 2017

Member

unsupported Supfile version ?

}

for i, network := range conf.Networks {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.