func debugBindFS() { bf, err := assets.NewBindFS(&assets.BindFSConfig{ InDir: root, OutDir: filepath.Join(tests, "debug"), Package: "debug", File: "debug", Gzipped: false, }) err = bf.Record() if err != nil { panic(err) } }
func productionBindFS() { bf, err := assets.NewBindFS(&assets.BindFSConfig{ InDir: root, OutDir: filepath.Join(tests, "prod"), Package: "prod", File: "prod", Gzipped: true, Production: true, }) err = bf.Record() if err != nil { panic(err) } }
func debugCompressBindFS() { bf, err := assets.NewBindFS(&assets.BindFSConfig{ InDir: root, OutDir: filepath.Join(tests, "debugnodecompress"), Package: "debug", File: "debug", Gzipped: true, NoDecompression: true, }) err = bf.Record() if err != nil { panic(err) } }
// BundleAssets creates a assets.BindFS, which when it receives any signal, updates the given file from its config func BundleAssets(config *assets.BindFSConfig) (flux.Reactor, error) { bindfs, err := assets.NewBindFS(config) if err != nil { return nil, err } return flux.Reactive(func(root flux.Reactor, err error, data interface{}) { // bindfs.Record() if err := bindfs.Record(); err != nil { root.ReplyError(err) return } root.Reply(true) }), nil }