// GetAll reads all bundle definitions in the bundlesDir repository and returns a
// map[string]*Definition of bundle names to their definition structs.
GetAll reads all bundle definitions in the bundlesDir repository and returns a
map[string]*Definition of bundle names to their definition structs.
// GetAll reads all bundle definitions in the bundlesDir repository and returns a // map [ string ] * Definition of bundle names to their definition structs .
func GetAll(bundlesDir string) (Set, error) {
	bundles := make(Set)
	err := filepath.Walk(filepath.Join(bundlesDir, "bundles"), func(p string, info os.FileInfo, err error) error {
		if err != nil {
			return err
		}
		if info.IsDir() {
			return nil
		}
		bundle, err := GetDefinition(info.Name(), bundlesDir)
		if err != nil {
			return err
		}
		bundles[info.Name()] = bundle
		return nil
	})
	if err != nil {
		return nil, err
	}
	pundles, err := ioutil.ReadFile(filepath.Join(bundlesDir, "packages"))
	if err != nil {
		return nil, err
	}
	for _, line := range strings.Split(string(pundles), "\n") {
		if strings.TrimSpace(line) == "" || strings.HasPrefix(line, "#") {
			continue
		}
		p, err := newDefinition(line, bundlesDir)
		if err != nil {
			return nil, err
		}
		pundle, err := getPundleDefinition(line, &p)
		if err != nil {
			return nil, err
		}
		bundles[line] = pundle
	}
	return bundles, nil
}
func GetAll ( bundlesDir string ) ( Set , error ) { bundles := make ( Set ) err := filepath . Walk ( filepath . Join ( bundlesDir , " " ) , func ( p string , info os . FileInfo , err error ) error { if err != nil { return err } if info . IsDir ( ) { return nil } bundle , err := GetDefinition ( info . Name ( ) , bundlesDir ) if err != nil { return err } bundles [ info . Name ( ) ] = bundle return nil } ) if err != nil { return nil , err } pundles , err := ioutil . ReadFile ( filepath . Join ( bundlesDir , " " ) ) if err != nil { return nil , err } for _ , line := range strings . Split ( string ( pundles ) , " \n " ) { if strings . TrimSpace ( line ) == " " || strings . HasPrefix ( line , " " ) { continue } p , err := newDefinition ( line , bundlesDir ) if err != nil { return nil , err } pundle , err := getPundleDefinition ( line , & p ) if err != nil { return nil , err } bundles [ line ] = pundle } return bundles , nil }
GetAll reads all bundle definitions in the bundlesDir repository and returns a
map[string]*Definition of bundle names to their definition structs.
GetAll reads all bundle definitions in the bundlesDir repository and returns a map [ string ] * Definition of bundle names to their definition structs .