mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-20 10:35:01 +00:00

* fix(embed): use go-rice for large backend assets Golang embed FS has a hard limit that we might exceed when providing many binary alternatives. Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * simplify golang deps Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * chore(tests): switch to testcontainers and print logs Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * fix(tests): do not build a test binary Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * small fixup Signed-off-by: Ettore Di Giacinto <mudler@localai.io> --------- Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
27 lines
445 B
Go
27 lines
445 B
Go
package assets
|
|
|
|
import (
|
|
"os"
|
|
|
|
rice "github.com/GeertJohan/go.rice"
|
|
"github.com/rs/zerolog/log"
|
|
)
|
|
|
|
func ListFiles(content *rice.Box) (files []string) {
|
|
err := content.Walk("", func(path string, info os.FileInfo, err error) error {
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
if info.IsDir() {
|
|
return nil
|
|
}
|
|
|
|
files = append(files, path)
|
|
return nil
|
|
})
|
|
if err != nil {
|
|
log.Error().Err(err).Msg("error walking the rice box")
|
|
}
|
|
return
|
|
}
|