code: func tarFromLocalDir(chartpath string, name string, repo string, version string) (string, error) {
  	destPath := filepath.Join(chartpath, "charts")
  
  	if !strings.HasPrefix(repo, "file://") {
  		return "", fmt.Errorf("wrong format: chart %s repository %s", name, repo)
  	}
  
  	origPath, err := resolver.GetLocalPath(repo, chartpath)
  	if err != nil {
  		return "", err
  	}
  
  	ch, err := chartutil.LoadDir(origPath)
  	if err != nil {
  		return "", err
  	}
  
  	constraint, err := semver.NewConstraint(version)
  	if err != nil {
  		return "", fmt.Errorf("dependency %s has an invalid version/constraint format: %s", name, err)
  	}
  
  	v, err := semver.NewVersion(ch.Metadata.Version)
  	if err != nil {
  		return "", err
  	}
  
  	if constraint.Check(v) {
  		_, err = chartutil.Save(ch, destPath)
  		return ch.Metadata.Version, err
  	}
  
  	return "", fmt.Errorf("can't get a valid version for dependency %s", name)
  }
docs: // tarFromLocalDir archive a dep chart from local directory and save it into charts/