fix: use path.Join for embed.FS paths to fix Windows build
filepath.Join uses OS-specific separators (backslash on Windows), but embed.FS always uses forward slashes. This caused schema file lookups to fail during Wails binding generation on Windows.
This commit is contained in:
@@ -9,7 +9,6 @@ import (
|
||||
"io/fs"
|
||||
"log/slog"
|
||||
"path"
|
||||
"path/filepath"
|
||||
|
||||
_ "modernc.org/sqlite" // Register sqlite driver.
|
||||
"yellowjacket/backend/database/sql/sqlcgen"
|
||||
@@ -61,7 +60,7 @@ func NewDB(logger *slog.Logger) (*DB, error) {
|
||||
|
||||
for _, dirEntry := range dirEntries {
|
||||
if !dirEntry.IsDir() {
|
||||
filePath := filepath.Join("sql/schemas", dirEntry.Name())
|
||||
filePath := path.Join("sql/schemas", dirEntry.Name())
|
||||
sqlContent, err := fs.ReadFile(schemas, filePath)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not read file %s: %w", filePath, err)
|
||||
|
||||
Reference in New Issue
Block a user