output to file by default
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"flag"
|
"flag"
|
||||||
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
"net/http"
|
"net/http"
|
||||||
@@ -88,12 +89,13 @@ func filejson[T any](path string) ([]T, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
ts := time.Now().UTC().Format(time.DateOnly) // can't use RFC3339 because :s in filename
|
||||||
var (
|
var (
|
||||||
dumpDir string
|
dumpDir string
|
||||||
out string
|
out string
|
||||||
)
|
)
|
||||||
flag.StringVar(&dumpDir, "dump", ".", "`dir`ectory containing umadump output files")
|
flag.StringVar(&dumpDir, "dump", ".", "`dir`ectory containing umadump output files")
|
||||||
flag.StringVar(&out, "o", "", "output `file` (default stdout)")
|
flag.StringVar(&out, "o", fmt.Sprintf("uma-col-all-%s.json", ts), "output `file` (stdout if empty)")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt)
|
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt)
|
||||||
@@ -142,7 +144,7 @@ func main() {
|
|||||||
Game: "umamusume",
|
Game: "umamusume",
|
||||||
Type: "collection",
|
Type: "collection",
|
||||||
Version: 4,
|
Version: 4,
|
||||||
Timestamp: time.Now().String(),
|
Timestamp: ts,
|
||||||
Servers: map[string]CollectionServer{
|
Servers: map[string]CollectionServer{
|
||||||
"en": {
|
"en": {
|
||||||
CharCards: charaLevels,
|
CharCards: charaLevels,
|
||||||
|
|||||||
Reference in New Issue
Block a user