1 diff --git a/internal/fileutils/assets.go b/internal/fileutils/assets.go
2 index 83eacd9..0b80e51 100644
3 --- a/internal/fileutils/assets.go
4 +++ b/internal/fileutils/assets.go
6 //go:generate rice embed
13 - rice "github.com/GeertJohan/go.rice"
14 - "github.com/go-flutter-desktop/hover/internal/log"
19 - assetsBoxOnce sync.Once
22 // AssetsBox hover's assets box
23 -func AssetsBox() *rice.Box {
24 - assetsBoxOnce.Do(func() {
26 - assetsBox, err = rice.FindBox("../../assets")
28 - log.Errorf("Failed to find hover assets: %v", err)
33 +func AssetsBox() string {
34 + return "@assetsFolder@"
36 diff --git a/internal/fileutils/file.go b/internal/fileutils/file.go
37 index cb75563..3822e80 100644
38 --- a/internal/fileutils/file.go
39 +++ b/internal/fileutils/file.go
40 @@ -11,8 +11,6 @@ import (
44 - rice "github.com/GeertJohan/go.rice"
46 "github.com/go-flutter-desktop/hover/internal/log"
49 @@ -215,24 +213,24 @@ func ExecuteTemplateFromFile(boxed, to string, templateData interface{}) {
52 // ExecuteTemplateFromAssetsBox create file from a template asset
53 -func ExecuteTemplateFromAssetsBox(boxed, to string, assetsBox *rice.Box, templateData interface{}) {
54 - templateString, err := assetsBox.String(boxed)
55 +func ExecuteTemplateFromAssetsBox(boxed, to string, assetsBox string, templateData interface{}) {
56 + templateString, err := ioutil.ReadFile(assetsBox + "/" + boxed)
58 log.Errorf("Failed to find template file: %v\n", err)
61 - executeTemplateFromString(templateString, to, templateData)
62 + executeTemplateFromString(string(templateString), to, templateData)
65 // CopyAsset copies a file from asset
66 -func CopyAsset(boxed, to string, assetsBox *rice.Box) {
67 +func CopyAsset(boxed string, to string, assetsBox string) {
68 file, err := os.Create(to)
70 log.Errorf("Failed to create %s: %v", to, err)
74 - boxedFile, err := assetsBox.Open(boxed)
75 + boxedFile, err := os.OpenFile(assetsBox + "/" + boxed, os.O_RDONLY, 0666)
77 log.Errorf("Failed to find boxed file %s: %v", boxed, err)