From 48d2e2e102cdeb5e4bc23da20400843edace6ff6 Mon Sep 17 00:00:00 2001 From: "Paul R. Tagliamonte" Date: Thu, 5 Mar 2020 17:42:29 -0500 Subject: [PATCH] fix namespace tomfoolery --- main.go | 10 +++++----- packages.json => pault.ag.json | 0 2 files changed, 5 insertions(+), 5 deletions(-) rename packages.json => pault.ag.json (100%) diff --git a/main.go b/main.go index f72e875..5dae8de 100644 --- a/main.go +++ b/main.go @@ -35,8 +35,8 @@ func writePage(w io.Writer, path string, pkg Package) error { return err } -func loadConfig() (ret []Package, err error) { - content, err := ioutil.ReadFile("packages.json") +func loadConfig(namespace string) (ret []Package, err error) { + content, err := ioutil.ReadFile(fmt.Sprintf("%s.json", namespace)) if err != nil { return } @@ -45,14 +45,14 @@ func loadConfig() (ret []Package, err error) { } func main() { - packages, err := loadConfig() + namespace := os.Args[1] + + packages, err := loadConfig(namespace) if err != nil { log.Fatalf("%s\n", err) return } - namespace := "pault.ag" - for _, pkg := range packages { packages := pkg.Packages packages = append(packages, "") diff --git a/packages.json b/pault.ag.json similarity index 100% rename from packages.json rename to pault.ag.json