Move config to dist and check in packr files

master
Nick Krichevsky 2019-02-27 00:00:30 -05:00
parent 8c09eecf68
commit eb416ede36
4 changed files with 43 additions and 4 deletions

8
config/config-packr.go Normal file
View File

@ -0,0 +1,8 @@
// +build !skippackr
// Code generated by github.com/gobuffalo/packr/v2. DO NOT EDIT.
// You can use the "packr clean" command to clean up this,
// and any other packr generated files.
package config
import _ "github.com/ollien/updown/packrd"

View File

@ -10,9 +10,10 @@ import (
)
const (
configPath = "/etc/updown/config.yml"
distConfigBoxName = "distConfig"
distConfigName = "config.yml.dist"
configPath = "/etc/updown/config.yml"
distBoxName = "distConfig"
distConfigName = "config.yml"
distConfigDir = "./dist"
)
// ErrDefaultConfig is thrown when the default configuration is used
@ -51,7 +52,7 @@ func shouldUseDistConfig() bool {
}
func parseDistConfig() (Config, error) {
distBox := packr.New(distConfigBoxName, "./")
distBox := packr.New(distBoxName, distConfigDir)
rawDistConfig, err := distBox.Find(distConfigName)
if err != nil {
return Config{}, err

30
packrd/packed-packr.go Normal file
View File

@ -0,0 +1,30 @@
// +build !skippackr
// Code generated by github.com/gobuffalo/packr/v2. DO NOT EDIT.
// You can use the "packr2 clean" command to clean up this,
// and any other packr generated files.
package packrd
import (
"github.com/gobuffalo/packr/v2"
"github.com/gobuffalo/packr/v2/file/resolver"
)
var _ = func() error {
const gk = "07e8bb9cc0e92b388d931015d6f05392"
g := packr.New(gk, "")
hgr, err := resolver.NewHexGzip(map[string]string{
"7c6ed5624126d170db055fc1ba1ccd8b": "1f8b08000000000000ff34c941aac3400800d0fd9cc2138c93bff9c1556f32d88e2481691435edf50b85ee1ebc4875dea41be74e80f9342c8393ef1cd22f3f084c23379720c41f6f531f3c778dc4cb86becf12e22f712a0000f38894b3f3184eb0fcfdd7565b5dbe65ea49b0b6b5954f000000ffffd7a2b95c79000000",
})
if err != nil {
panic(err)
}
g.DefaultResolver = hgr
func() {
b := packr.New("distConfig", "./dist")
b.SetResolver("config.yml", packr.Pointer{ForwardBox: gk, ForwardPath: "7c6ed5624126d170db055fc1ba1ccd8b"})
}()
return nil
}()