Skip to content

Commit 9fdf6b8

Browse files
authored
Merge pull request #153 from mattn/fix-export-port
Fix exported upstart PORT values
2 parents fd6dba5 + 309a21d commit 9fdf6b8

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

export.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
)
99

1010
func exportUpstart(cfg *config, path string) error {
11-
for i, proc := range procs {
11+
for _, proc := range procs {
1212
f, err := os.Create(filepath.Join(path, "app-"+proc.name+".conf"))
1313
if err != nil {
1414
return err
@@ -40,7 +40,9 @@ func exportUpstart(cfg *config, path string) error {
4040
}
4141
}
4242

43-
fmt.Fprintf(f, "env PORT=%d\n", cfg.BasePort+uint(i))
43+
if proc.setPort {
44+
fmt.Fprintf(f, "env PORT=%d\n", proc.port)
45+
}
4446
for k, v := range env {
4547
fmt.Fprintf(f, "env %s='%s'\n", k, strings.Replace(v, "'", "\\'", -1))
4648
}

0 commit comments

Comments
 (0)