Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added parameter to specify a second source folder for Lua script and XML #79

Merged
merged 5 commits into from
Nov 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
@@ -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.")
@@ -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))
@@ -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)