30 lines
684 B
Go
30 lines
684 B
Go
// Command demo-seed seeds the synthetic demonstration world of an isolated
|
|
// demo stand, checks whether a reset may discard the stand's database, and
|
|
// prints an inventory of counts. It requires DEMO_MODE=isolated.
|
|
package main
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"os"
|
|
"os/signal"
|
|
"syscall"
|
|
"time"
|
|
|
|
"lincodex/backend/internal/adapter/primary/cli/demoseed"
|
|
)
|
|
|
|
func main() {
|
|
os.Exit(run())
|
|
}
|
|
|
|
func run() int {
|
|
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
|
|
defer stop()
|
|
if err := demoseed.Run(ctx, os.Args[1:], os.LookupEnv, os.Stdout, time.Now); err != nil {
|
|
_, _ = fmt.Fprintf(os.Stderr, "demo-seed: %v\n", err)
|
|
return 2
|
|
}
|
|
return 0
|
|
}
|