func()

in internal/core/component.go [580:604]


func (c Component) UpdateComponentPath(startingPath string, environments []string) (root Component, err error) {
	logger.Debug(fmt.Sprintf("Update component path'%s'", c.Name))

	if c.Method != "git" {
		return c, err
	}

	if c.ComponentType == "component" || c.ComponentType == "" {
		relativePath := c.RelativePathTo()
		c.PhysicalPath = path.Join(relativePath, c.Path)
		if !filepath.IsAbs(c.RelativePathTo()) {
			c.PhysicalPath = path.Join(startingPath, c.PhysicalPath)
		}

		c, err = c.LoadComponent()
		if err != nil {
			return c, err
		}

		if err = c.LoadConfig(environments); err != nil {
			return c, err
		}
	}
	return c, err
}