Skip to content

Commit

Permalink
Support Supfile.yml
Browse files Browse the repository at this point in the history
Fixes #100
  • Loading branch information
VojtechVitek committed Jan 16, 2018
1 parent 2bdad7e commit 90baaa3
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions cmd/sup/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (f *flagStringSlice) Set(value string) error {
}

func init() {
flag.StringVar(&supfile, "f", "./Supfile", "Custom path to Supfile")
flag.StringVar(&supfile, "f", "", "Custom path to ./Supfile[.yml]")
flag.Var(&envVars, "e", "Set environment variables")
flag.Var(&envVars, "env", "Set environment variables")
flag.StringVar(&sshConfig, "sshconfig", "", "Read SSH Config file, ie. ~/.ssh/config file")
Expand Down Expand Up @@ -211,10 +211,16 @@ func main() {
return
}

if supfile == "" {
supfile = "./Supfile"
}
data, err := ioutil.ReadFile(resolvePath(supfile))
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
data, err = ioutil.ReadFile(resolvePath("./Supfile.yml")) // Alternative to ./Supfile.
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}
conf, err := sup.NewSupfile(data)
if err != nil {
Expand Down

0 comments on commit 90baaa3

Please sign in to comment.