Skip to content

Commit

Permalink
minor refactor on command parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
andrestc committed Mar 29, 2018
1 parent df68e07 commit 4479241
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@ func main() {
}
appName := os.Args[3]
command := os.Args[4:]
if command[len(command)-1] == "build" {

switch command[len(command)-1] {
case "build":
build(c, appName, command[:len(command)-1])
return
}
if command[len(command)-1] == "deploy-only" {
case "deploy-only":
deploy(c, appName)
return
}
// backward compatibility with tsuru < 1.4.0
if command[len(command)-1] == "deploy" {
case "deploy":
// backward compatibility with tsuru < 1.4.0
command = command[:len(command)-1]
fallthrough
default:
build(c, appName, command)
deploy(c, appName)
}
build(c, appName, command)
deploy(c, appName)
}

0 comments on commit 4479241

Please sign in to comment.