Skip to content

Commit 875d4f9

Browse files
committed
fix: correctly bundle css files
1 parent 1fe5dcb commit 875d4f9

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

assets/embed.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"fmt"
88
"os"
99
"path/filepath"
10+
"runtime"
1011
"sort"
1112
"strings"
1213
)
@@ -46,8 +47,16 @@ var (
4647
var CombinedCSS []byte
4748

4849
func init() {
50+
// Get the directory of the current source file to ensure css files are found
51+
_, currentFile, _, ok := runtime.Caller(0)
52+
if !ok {
53+
panic("failed to get current file path")
54+
}
55+
currentDir := filepath.Dir(currentFile)
56+
cssDir := filepath.Join(currentDir, "css")
57+
4958
// Generate the combined css file
50-
matches, err := filepath.Glob("assets/css/*.css")
59+
matches, err := filepath.Glob(filepath.Join(cssDir, "*.css"))
5160
if err != nil {
5261
panic(err)
5362
}

0 commit comments

Comments
 (0)