func ensureHome() error {
	configDirectories := []string{homePath(), repositoryDirectory(), cacheDirectory(), localRepoDirectory()}

	for _, p := range configDirectories {
		if fi, err := os.Stat(p); err != nil {
			fmt.Printf("Creating %s \n", p)
			if err := os.MkdirAll(p, 0755); err != nil {
				return fmt.Errorf("Could not create %s: %s", p, err)
			}
		} else if !fi.IsDir() {
			return fmt.Errorf("%s must be a directory", p)
		}
	}

	repoFile := repositoriesFile()
	if fi, err := os.Stat(repoFile); err != nil {
		fmt.Printf("Creating %s \n", repoFile)
		if _, err := os.Create(repoFile); err != nil {
			return err
		}
		if err := addRepository(defaultRepository, defaultRepositoryURL); err != nil {
			return err
		}
	} else if fi.IsDir() {
		return fmt.Errorf("%s must be a file, not a directory", repoFile)
	}

	localRepoIndexFile := localRepoDirectory(localRepoIndexFilePath)
	if fi, err := os.Stat(localRepoIndexFile); err != nil {
		fmt.Printf("Creating %s \n", localRepoIndexFile)
		_, err := os.Create(localRepoIndexFile)
		if err != nil {
			return err
		}

		//TODO: take this out and replace with helm update functionality
		os.Symlink(localRepoIndexFile, cacheDirectory("local-index.yaml"))
	} else if fi.IsDir() {
		return fmt.Errorf("%s must be a file, not a directory", localRepoIndexFile)
	}

	fmt.Printf("$HELM_HOME has been configured at %s.\n", helmHome)
	return nil
}
// ensureHome checks to see if $HELM_HOME exists
//
// If $HELM_HOME does not exist, this function will create it.
ensureHome checks to see if $HELM_HOME exists

If $HELM_HOME does not exist, this function will create it.
// ensureHome checks to see if $HELM_HOME exists // // If $HELM_HOME does not exist this function will create it .
func ensureHome() error {
	configDirectories := []string{homePath(), repositoryDirectory(), cacheDirectory(), localRepoDirectory()}
	for _, p := range configDirectories {
		if fi, err := os.Stat(p); err != nil {
			fmt.Printf("Creating %s \n", p)
			if err := os.MkdirAll(p, 0755); err != nil {
				return fmt.Errorf("Could not create %s: %s", p, err)
			}
		} else if !fi.IsDir() {
			return fmt.Errorf("%s must be a directory", p)
		}
	}
	repoFile := repositoriesFile()
	if fi, err := os.Stat(repoFile); err != nil {
		fmt.Printf("Creating %s \n", repoFile)
		if _, err := os.Create(repoFile); err != nil {
			return err
		}
		if err := addRepository(defaultRepository, defaultRepositoryURL); err != nil {
			return err
		}
	} else if fi.IsDir() {
		return fmt.Errorf("%s must be a file, not a directory", repoFile)
	}
	localRepoIndexFile := localRepoDirectory(localRepoIndexFilePath)
	if fi, err := os.Stat(localRepoIndexFile); err != nil {
		fmt.Printf("Creating %s \n", localRepoIndexFile)
		_, err := os.Create(localRepoIndexFile)
		if err != nil {
			return err
		}
		os.Symlink(localRepoIndexFile, cacheDirectory("local-index.yaml"))
	} else if fi.IsDir() {
		return fmt.Errorf("%s must be a file, not a directory", localRepoIndexFile)
	}
	fmt.Printf("$HELM_HOME has been configured at %s.\n", helmHome)
	return nil
}
func ensureHome ( ) error { configDirectories := [ ] string { homePath ( ) , repositoryDirectory ( ) , cacheDirectory ( ) , localRepoDirectory ( ) } for _ , p := range configDirectories { if fi , err := os . Stat ( p ) ; err != nil { fmt . Printf ( " \n " , p ) if err := os . MkdirAll ( p , 0755 ) ; err != nil { return fmt . Errorf ( " " , p , err ) } } else if ! fi . IsDir ( ) { return fmt . Errorf ( " " , p ) } } repoFile := repositoriesFile ( ) if fi , err := os . Stat ( repoFile ) ; err != nil { fmt . Printf ( " \n " , repoFile ) if _ , err := os . Create ( repoFile ) ; err != nil { return err } if err := addRepository ( defaultRepository , defaultRepositoryURL ) ; err != nil { return err } } else if fi . IsDir ( ) { return fmt . Errorf ( " " , repoFile ) } localRepoIndexFile := localRepoDirectory ( localRepoIndexFilePath ) if fi , err := os . Stat ( localRepoIndexFile ) ; err != nil { fmt . Printf ( " \n " , localRepoIndexFile ) _ , err := os . Create ( localRepoIndexFile ) if err != nil { return err } os . Symlink ( localRepoIndexFile , cacheDirectory ( " " ) ) } else if fi . IsDir ( ) { return fmt . Errorf ( " " , localRepoIndexFile ) } fmt . Printf ( " \n " , helmHome ) return nil }
ensureHome checks to see if $HELM_HOME exists
ensureHome checks to see if $HELM_HOME exists
//TODO: take this out and replace with helm update functionality