@@ -13,27 +13,27 @@ import (
1313)
1414
1515func main () {
16+ baseDir := flag .String ("base-dir" , "." , "The directory containing the base files" )
1617 configPath := flag .String ("config" , "" , "Path to config file" )
1718 resourcesPath := flag .String ("resources" , "" , "Path to resources file" )
1819 isGenResource := flag .Bool ("generate-metadata" , false , "Whether to generate metadata for server" )
1920 isServiceModrinth := flag .Bool ("modrinth" , false , "Use Modrinth to add download links" )
2021 flag .Parse ()
2122
22- utils .LogMessage ("Config file: " + * configPath )
23- utils .LogMessage ("Resources file: " + * resourcesPath )
24-
2523 config , err := parsers .LoadConfig (* configPath )
2624 if err != nil {
2725 utils .LogError (err )
2826 return
2927 }
28+ utils .LogMessage ("Config file: " + * configPath )
3029
3130 resources , err := parsers .LoadResource (* resourcesPath )
3231 if err != nil {
3332 resources = & parsers.ResourceSet {
3433 Name : config .Name ,
3534 LocalVersion : "1.0.0" ,
3635 ResourceSetHash : "" ,
36+ Patches : []parsers.Patches {},
3737 Resources : []parsers.Resource {},
3838 }
3939
@@ -45,6 +45,7 @@ func main() {
4545 }
4646 utils .LogWarning ("Missing resource.json! Creating one at " + * resourcesPath )
4747 }
48+ utils .LogMessage ("Resources file: " + * resourcesPath )
4849
4950 a := app .New ()
5051 mw := gui .NewMainWindow (a , config , resources )
@@ -58,9 +59,9 @@ func main() {
5859 go func () {
5960 if * isGenResource {
6061 utils .LogMessage ("Generating metadata for server..." )
61- workers .RunGenSourceSequence (config , resources , "." , * resourcesPath , mw .UpdateProgress , mw .HandleError , * isServiceModrinth )
62+ workers .RunGenSourceSequence (config , resources , * baseDir , * resourcesPath , mw .UpdateProgress , mw .HandleError , * isServiceModrinth )
6263 } else {
63- workers .RunUpdateSequence (config , resources , "." , mw .UpdateProgress , mw .HandleError )
64+ workers .RunUpdateSequence (config , resources , * baseDir , * resourcesPath , mw .UpdateProgress , mw .HandleError )
6465 }
6566 }()
6667
0 commit comments