Skip to content

Commit 99ccc26

Browse files
committed
fix(nginx): actually write to vhost file on disk
1 parent 4f0e2a6 commit 99ccc26

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

subcmd/nginx.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ type nginxVhostConf struct {
181181
func (nvf *nginxVhostFactory) createHost(conf *nginxVhostConf) error {
182182
// Open vhost file for writing template
183183
p := filepath.Join(nginxVhostAvailableDir, conf.Hostname)
184-
_, err := os.OpenFile(p, os.O_WRONLY, 0644)
184+
f, err := os.OpenFile(p, os.O_WRONLY, 0644)
185185
if err != nil {
186186
return fmt.Errorf("could not open %s for writing: %s", p, err)
187187
}
@@ -193,7 +193,7 @@ func (nvf *nginxVhostFactory) createHost(conf *nginxVhostConf) error {
193193
}
194194

195195
// Render template with config and write to file
196-
if err := t.Execute(os.Stdout, conf); err != nil {
196+
if err := t.Execute(f, conf); err != nil {
197197
return fmt.Errorf("could not write nginx vhost template to file: %s", err)
198198
}
199199

0 commit comments

Comments
 (0)