WIP: generating new apps.json
This commit is contained in:
parent
fdd46a4d98
commit
d188327b17
|
@ -1,6 +1,8 @@
|
||||||
package catalogue
|
package catalogue
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"io/ioutil"
|
||||||
"path"
|
"path"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
@ -93,8 +95,24 @@ var catalogueGenerateCommand = &cli.Command{
|
||||||
<-ch // wait for everything
|
<-ch // wait for everything
|
||||||
}
|
}
|
||||||
|
|
||||||
// for reach app, build the recipemeta from parsing
|
catl := make(catalogue.RecipeCatalogue)
|
||||||
// spit out a JSON file
|
for recipeName := range recipes {
|
||||||
|
// TODO: gather more metadata
|
||||||
|
catl[recipeName] = catalogue.RecipeMeta{
|
||||||
|
Name: recipeName,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
recipesJSON, err := json.MarshalIndent(catl, "", " ")
|
||||||
|
if err != nil {
|
||||||
|
logrus.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := ioutil.WriteFile(config.APPS_JSON, recipesJSON, 0644); err != nil {
|
||||||
|
logrus.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
logrus.Debugf("generated new recipe catalogue in '%s'", config.APPS_JSON)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue