Example #1
0
func (self *FinderNode) NodeExpand(ns types.Namespace) error {
	if self.expanded {
		return nil
	}

	// this does purely textual expansion, e.g. convert
	// <$src/**/*.$ext> to a new FinderNode that will actually find
	// files because '$src' and '$ext' get expanded
	expandlist := func(strings []string) error {
		var err error
		for i, pat := range strings {
			_, strings[i], err = types.ExpandString(pat, ns, nil)
			if err != nil {
				return err
			}
		}
		return nil
	}

	err := expandlist(self.includes)
	if err != nil {
		return err
	}
	err = expandlist(self.excludes)
	if err != nil {
		return err
	}
	self.expanded = true
	return nil
}
Example #2
0
File: node.go Project: sbinet/fubsy
func (self *nodebase) NodeExpand(ns types.Namespace) error {
	if self.expanded {
		return nil
	}
	_, name, err := types.ExpandString(self.name, ns, nil)
	if err != nil {
		return err
	}
	self.name = name
	self.expanded = true
	return nil
}