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