Skip to content

Commit

Permalink
remove gobinddata
Browse files Browse the repository at this point in the history
  • Loading branch information
chenhg5 committed Apr 9, 2024
1 parent 4ae10a9 commit 780de54
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions compile_assets.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,9 @@ import (
"path/filepath"
"regexp"
"strings"

"github.com/jteeuwen/go-bindata"
)

func compileAsset(rootPath, outputPath, packageName string) {
cfg := bindata.NewConfig()
cfg.Package = packageName
cfg.Output = outputPath + "assets.go"
cfg.Input = make([]bindata.InputConfig, 0)
cfg.Input = append(cfg.Input, parseInput(rootPath+"..."))
checkError(bindata.Translate(cfg))

rootPathArr := strings.Split(rootPath, "assets")
if len(rootPathArr) > 0 {
listContent := `package ` + packageName + `
Expand Down Expand Up @@ -88,17 +79,4 @@ func getAllFiles(dirPth string) (files []string, err error) {
}

return files, nil
}

func parseInput(path string) bindata.InputConfig {
if strings.HasSuffix(path, "/...") {
return bindata.InputConfig{
Path: filepath.Clean(path[:len(path)-4]),
Recursive: true,
}
}
return bindata.InputConfig{
Path: filepath.Clean(path),
Recursive: false,
}
}
}

0 comments on commit 780de54

Please sign in to comment.