fix: switch back to replacing <recipe>.example.com #228
|
@ -2,7 +2,6 @@ package config
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"html/template"
|
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
|
@ -321,24 +320,15 @@ func TemplateAppEnvSample(recipeName, appName, server, domain string) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
file, err := os.OpenFile(appEnvPath, os.O_RDWR, 0664)
|
read, err := ioutil.ReadFile(appEnvPath)
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
defer file.Close()
|
|
||||||
|
|
||||||
tpl, err := template.ParseFiles(appEnvPath)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
type templateVars struct {
|
newContents := strings.Replace(string(read), recipeName+".example.com", domain, -1)
|
||||||
Name string
|
|
||||||
Domain string
|
|
||||||
}
|
|
||||||
|
|
||||||
tvars := templateVars{Name: recipeName, Domain: domain}
|
err = ioutil.WriteFile(appEnvPath, []byte(newContents), 0)
|
||||||
if err := tpl.Execute(file, tvars); err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
3wordchant marked this conversation as resolved
Outdated
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
return err
ugh thought i caught all my half-baked copypasta, fixing!