v0.0.145
This commit is contained in:
parent
8affa81bb9
commit
d0954bf133
@ -55,12 +55,13 @@ func GenerateEnumSpecs(sourceDir string, destFile string) error {
|
||||
}
|
||||
}
|
||||
|
||||
langext.ArrFilter(files, func(v os.DirEntry) bool { return v.Name() != path.Base(destFile) })
|
||||
files = langext.ArrFilter(files, func(v os.DirEntry) bool { return v.Name() != path.Base(destFile) })
|
||||
files = langext.ArrFilter(files, func(v os.DirEntry) bool { return strings.HasSuffix(v.Name(), ".go") })
|
||||
langext.SortBy(files, func(v os.DirEntry) string { return v.Name() })
|
||||
|
||||
newChecksumStr := goext.GoextVersion
|
||||
for _, f := range files {
|
||||
content, err := os.ReadFile(destFile)
|
||||
content, err := os.ReadFile(path.Join(sourceDir, f.Name()))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -81,15 +82,8 @@ func GenerateEnumSpecs(sourceDir string, destFile string) error {
|
||||
pkgname := ""
|
||||
|
||||
for _, f := range files {
|
||||
if !strings.HasSuffix(f.Name(), ".go") {
|
||||
continue
|
||||
}
|
||||
if f.Name() == path.Base(destFile) {
|
||||
continue
|
||||
}
|
||||
|
||||
fmt.Printf("========= %s =========\n\n", f.Name())
|
||||
fileEnums, pn, err := processFile(f.Name())
|
||||
fileEnums, pn, err := processFile(path.Join(sourceDir, f.Name()))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
15
bfcodegen/enum-generate_test.go
Normal file
15
bfcodegen/enum-generate_test.go
Normal file
@ -0,0 +1,15 @@
|
||||
package bfcodegen
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestApplyEnvOverridesSimple(t *testing.T) {
|
||||
|
||||
err := GenerateEnumSpecs("/home/mike/Code/reiff/badennet/bnet-backend/models", "/home/mike/Code/reiff/badennet/bnet-backend/models/enums_gen.go")
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
t.Fail()
|
||||
}
|
||||
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
package goext
|
||||
|
||||
const GoextVersion = "0.0.144"
|
||||
const GoextVersion = "0.0.145"
|
||||
|
||||
const GoextVersionTimestamp = "2023-06-07T12:39:21+0200"
|
||||
const GoextVersionTimestamp = "2023-06-07T12:45:48+0200"
|
||||
|
Loading…
Reference in New Issue
Block a user