diff --git a/internal/template/template.go b/internal/template/template.go index 93aeb17..a220ca4 100644 --- a/internal/template/template.go +++ b/internal/template/template.go @@ -31,7 +31,7 @@ var registry = map[string]Template{ "defold": {Repo: "asobi-defold-demo", Ref: "v0.2.0", Name: "Defold"}, "godot": {Repo: "asobi-godot-demo", Ref: "v0.2.0", Name: "Godot"}, "unity": {Repo: "asobi-unity-demo", Ref: "v0.2.0", Name: "Unity"}, - "backend": {Repo: "sdk_demo_backend", Ref: "v0.1.0", Name: "Backend"}, + "backend": {Repo: "sdk_demo_backend", Ref: "v0.2.0", Name: "Backend"}, } const ( diff --git a/internal/template/template_test.go b/internal/template/template_test.go index 5b32a37..d5dba7e 100644 --- a/internal/template/template_test.go +++ b/internal/template/template_test.go @@ -173,4 +173,24 @@ func TestFetchE2E(t *testing.T) { if _, err := os.Stat(filepath.Join(dir, "lua", "match.lua")); err != nil { t.Errorf("defold template missing bundled lua/match.lua: %v", err) } + + // The backend template must ship a multi-mode manifest (config.lua mapping + // more than one mode to more than one script), so it demonstrates how to + // deploy different modes - not just the single default. + bdir := t.TempDir() + if _, err := Fetch("backend", bdir); err != nil { + t.Fatalf("Fetch(backend): %v", err) + } + manifest, err := os.ReadFile(filepath.Join(bdir, "lua", "config.lua")) + if err != nil { + t.Fatalf("backend template missing lua/config.lua: %v", err) + } + for _, script := range []string{"match.lua", "party.lua"} { + if !strings.Contains(string(manifest), script) { + t.Errorf("config.lua manifest does not map %q; got:\n%s", script, manifest) + } + if _, err := os.Stat(filepath.Join(bdir, "lua", script)); err != nil { + t.Errorf("backend template missing lua/%s: %v", script, err) + } + } }