package main

import (
	"fmt"
	"os"

	ops "fn-registry/fn_operations"
)

func main() {
	path := "fn_operations/project_template/operations.db"
	if len(os.Args) > 1 {
		path = os.Args[1]
	}

	// Remove existing template
	os.Remove(path)

	db, err := ops.Open(path)
	if err != nil {
		fmt.Fprintf(os.Stderr, "error: %v\n", err)
		os.Exit(1)
	}
	defer db.Close()

	fmt.Printf("Template DB created at %s\n", path)
}
