diff options
Diffstat (limited to 'cmd/deploy/deploy.go')
| -rw-r--r-- | cmd/deploy/deploy.go | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/cmd/deploy/deploy.go b/cmd/deploy/deploy.go index ee7ee4a..31aabe5 100644 --- a/cmd/deploy/deploy.go +++ b/cmd/deploy/deploy.go | |||
| @@ -78,26 +78,15 @@ func runDeploy(args []string) { | |||
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | func deployApp(host, domain, name, binaryPath string, portOverride int, envVars []string, envFile, args string, files []string) { | 80 | func deployApp(host, domain, name, binaryPath string, portOverride int, envVars []string, envFile, args string, files []string) { |
| 81 | // Determine app name | 81 | // Require binary path |
| 82 | if name == "" { | 82 | if binaryPath == "" { |
| 83 | if binaryPath != "" { | 83 | fmt.Fprintf(os.Stderr, "Error: --binary is required\n") |
| 84 | name = filepath.Base(binaryPath) | 84 | os.Exit(1) |
| 85 | } else { | ||
| 86 | // Try to find a binary in current directory | ||
| 87 | cwd, _ := os.Getwd() | ||
| 88 | name = filepath.Base(cwd) | ||
| 89 | } | ||
| 90 | } | 85 | } |
| 91 | 86 | ||
| 92 | // Find binary if not specified | 87 | // Determine app name from binary if not specified |
| 93 | if binaryPath == "" { | 88 | if name == "" { |
| 94 | // Look for binary with same name as directory | 89 | name = filepath.Base(binaryPath) |
| 95 | if _, err := os.Stat(name); err == nil { | ||
| 96 | binaryPath = name | ||
| 97 | } else { | ||
| 98 | fmt.Fprintf(os.Stderr, "Error: --binary is required (could not find binary in current directory)\n") | ||
| 99 | os.Exit(1) | ||
| 100 | } | ||
| 101 | } | 90 | } |
| 102 | 91 | ||
| 103 | // Verify binary exists | 92 | // Verify binary exists |
