forked from toolshed/abra
		
	WIP: generating new apps.json
This commit is contained in:
		@ -1,6 +1,8 @@
 | 
			
		||||
package catalogue
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"encoding/json"
 | 
			
		||||
	"io/ioutil"
 | 
			
		||||
	"path"
 | 
			
		||||
	"strings"
 | 
			
		||||
 | 
			
		||||
@ -93,8 +95,24 @@ var catalogueGenerateCommand = &cli.Command{
 | 
			
		||||
			<-ch // wait for everything
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		// for reach app, build the recipemeta from parsing
 | 
			
		||||
		// spit out a JSON file
 | 
			
		||||
		catl := make(catalogue.RecipeCatalogue)
 | 
			
		||||
		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
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user