Adds a configuration layer for use rollup.yml which may be preferred over CLI flags.

This commit is contained in:
Arik Jones
2024-09-05 23:41:39 -05:00
parent f376f186c2
commit 0163c4e504
7 changed files with 527 additions and 153 deletions

18
main.go
View File

@@ -2,12 +2,30 @@ package main
import (
"fmt"
"log"
"os"
"github.com/tnypxl/rollup/cmd"
"github.com/tnypxl/rollup/internal/config"
"github.com/tnypxl/rollup/internal/scraper"
)
var cfg *config.Config
func main() {
configPath := config.DefaultConfigPath()
var err error
cfg, err = config.Load(configPath)
if err != nil {
log.Fatalf("Failed to load configuration: %v", err)
}
err = scraper.InitPlaywright()
if err != nil {
log.Fatalf("Failed to initialize Playwright: %v", err)
}
defer scraper.ClosePlaywright()
if err := cmd.Execute(); err != nil {
fmt.Println(err)
os.Exit(1)