Files
bap-room-packager/main.go
2025-12-24 13:58:02 -06:00

36 lines
829 B
Go

package main
import "flag"
func main() {
if err := mainErr(); err != nil {
panic(err)
}
}
func mainErr() error {
basePath := flag.String("basePath", "./rooms", "path to your rooms collection")
outPath := flag.String("outPath", "./rooms_out", "output path")
roomPerNight := flag.Int("roomPerNight", 4, "rooms per night")
splash1len := flag.Int("splash1", 2, "number of seconds splashscreen 1 will take")
splash2len := flag.Int("splash2", 2, "number of seconds splashscreen 2 will take")
flag.Parse()
roomFolders, err := LoadRoomFolders(*basePath)
if err != nil {
return err
}
AssignExtraRooms(roomFolders, *roomPerNight)
// only deletes DATA/NIGHT_* folders and the CF.ini file
err = EmptyOut(*outPath)
if err != nil {
return err
}
return CopyOut(roomFolders, *outPath, *splash1len, *splash2len)
}