Skip to content

Commit

Permalink
Merge pull request #79 from Chr1Z93/additional-source
Browse files Browse the repository at this point in the history
Added parameter to specify a second source folder for Lua script and XML
  • Loading branch information
argonui authored Nov 24, 2024
2 parents 2489e3b + cdc69f1 commit 77d4d82
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (

var (
moddir = flag.String("moddir", "testdata/simple", "a directory containing tts mod configs")
bonusdir = flag.String("bonusdir", "", "additional folder to check for Lua and XML require/include")
rev = flag.Bool("reverse", false, "instead of building a json from file structure, build file structure from json.")
writeToSrc = flag.Bool("writesrc", false, "when unbundling Lua, save the included 'require' files to the src/ directory.")
modfile = flag.String("modfile", "", "where to read from when reversing.")
Expand All @@ -37,11 +38,19 @@ func main() {
}

lua := file.NewTextOpsMulti(
[]string{filepath.Join(*moddir, luasrcSubdir), filepath.Join(*moddir, objectsSubdir)},
[]string{
filepath.Join(*moddir, luasrcSubdir),
filepath.Join(*moddir, objectsSubdir),
filepath.Join(*bonusdir, luasrcSubdir),
},
filepath.Join(*moddir, objectsSubdir),
)
xml := file.NewTextOpsMulti(
[]string{filepath.Join(*moddir, xmlsrcSubdir), filepath.Join(*moddir, objectsSubdir)},
[]string{
filepath.Join(*moddir, xmlsrcSubdir),
filepath.Join(*moddir, objectsSubdir),
filepath.Join(*bonusdir, xmlsrcSubdir),
},
filepath.Join(*moddir, objectsSubdir),
)
xmlSrc := file.NewTextOps(filepath.Join(*moddir, xmlsrcSubdir))
Expand All @@ -59,11 +68,19 @@ func main() {
objs = file.NewJSONOps(filepath.Dir(*objin))
objdir = file.NewDirOps(filepath.Dir(*objin))
lua = file.NewTextOpsMulti(
[]string{filepath.Join(*moddir, luasrcSubdir), filepath.Dir(*objin)},
[]string{
filepath.Join(*moddir, luasrcSubdir),
filepath.Join(*bonusdir, luasrcSubdir),
filepath.Dir(*objin),
},
filepath.Dir(*objout),
)
xml = file.NewTextOpsMulti(
[]string{filepath.Join(*moddir, xmlsrcSubdir), filepath.Dir(*objin)},
[]string{
filepath.Join(*moddir, xmlsrcSubdir),
filepath.Join(*bonusdir, xmlsrcSubdir),
filepath.Dir(*objin),
},
filepath.Dir(*objout),
)
basename = filepath.Base(*objout)
Expand Down

0 comments on commit 77d4d82

Please sign in to comment.