fix namespace tomfoolery

This commit is contained in:
Paul R. Tagliamonte 2020-03-05 17:42:29 -05:00
parent f43c175c27
commit 48d2e2e102
2 changed files with 5 additions and 5 deletions

10
main.go
View file

@ -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, "")