// repoRemove removes one or more chart repositories. Returns without any changes
// if no repositories are configured. Code ported from:
// https://github.com/helm/helm/blob/v3.4.2/cmd/helm/repo_remove.go
repoRemove removes one or more chart repositories. Returns without any changes
if no repositories are configured.
// repoRemove removes one or more chart repositories . Returns without any changes // if no repositories are configured . Code ported from : // https : // github . com / helm / helm / blob / v3 . 4 . 2 / cmd / helm / repo_remove . go
func (o *repoRemoveOptions) repoRemove() error {
	repoFile, err := repo.LoadFile(o.repoFile)
	if os.IsNotExist(errors.Cause(err)) || len(repoFile.Repositories) == 0 {
		log.Debug("No repositories configured.")
		return nil
	}
	if err != nil {
		return trace.Wrap(err)
	}
	for _, name := range o.names {
		if !repoFile.Remove(name) {
			log.WithField("repo", name).Debug("Repo was not found.")
			continue
		}
		if err := repoFile.WriteFile(o.repoFile, defaults.SharedReadMask); err != nil {
			return trace.Wrap(err)
		}
		if err := removeRepoCache(o.repoCache, name); err != nil {
			return trace.Wrap(err)
		}
		log.WithField("repo", name).Info("Repo has been removed from your repositories.")
	}
	return nil
}
func ( o * repoRemoveOptions ) repoRemove ( ) error { repoFile , err := repo . LoadFile ( o . repoFile ) if os . IsNotExist ( errors . Cause ( err ) ) || len ( repoFile . Repositories ) == 0 { log . Debug ( " " ) return nil } if err != nil { return trace . Wrap ( err ) } for _ , name := range o . names { if ! repoFile . Remove ( name ) { log . WithField ( " " , name ) . Debug ( " " ) continue } if err := repoFile . WriteFile ( o . repoFile , defaults . SharedReadMask ) ; err != nil { return trace . Wrap ( err ) } if err := removeRepoCache ( o . repoCache , name ) ; err != nil { return trace . Wrap ( err ) } log . WithField ( " " , name ) . Info ( " " ) } return nil }
repoRemove removes one or more chart repositories.
repoRemove removes one or more chart repositories .