func RunHelmCommand(args ...string) (Result, error) {
	var result Result
	var outbuf, errbuf bytes.Buffer

	cmd := exec.Command(viper.GetString("helm"), args...)

	log.Debugf("Executing command:  %v", cmd.Args)

	cmd.Stdout = &outbuf
	cmd.Stderr = &errbuf

	var err = cmd.Run()

	log.Debugf("Execution complete.")

	result.Stdout = strings.Trim(outbuf.String(), " ")
	result.Stderr = strings.Trim(errbuf.String(), " ")

	if err != nil {
		//
		// This crafty snippet is from https://stackoverflow.com/questions/10385551/get-exit-code-go
		//
		if exitError, ok := err.(*exec.ExitError); ok {
			result.ExitCode = exitError.Sys().(syscall.WaitStatus).ExitStatus()
		} else {
			if result.Stderr == "" {
				result.Stderr = err.Error()
			}
		}
	}

	return result, err
}
// RunHelmCommand runs the given command against helm
RunHelmCommand runs the given command against helm
// RunHelmCommand runs the given command against helm
func RunHelmCommand(args ...string) (Result, error) {
	var result Result
	var outbuf, errbuf bytes.Buffer
	cmd := exec.Command(viper.GetString("helm"), args...)
	log.Debugf("Executing command:  %v", cmd.Args)
	cmd.Stdout = &outbuf
	cmd.Stderr = &errbuf
	var err = cmd.Run()
	log.Debugf("Execution complete.")
	result.Stdout = strings.Trim(outbuf.String(), " ")
	result.Stderr = strings.Trim(errbuf.String(), " ")
	if err != nil {
		 This crafty snippet is from https:stackoverflow.com/questions/10385551/get-exit-code-go
		if exitError, ok := err.(*exec.ExitError); ok {
			result.ExitCode = exitError.Sys().(syscall.WaitStatus).ExitStatus()
		} else {
			if result.Stderr == "" {
				result.Stderr = err.Error()
			}
		}
	}
	return result, err
}
func RunHelmCommand ( args ... string ) ( Result , error ) { var result Result var outbuf , errbuf bytes . Buffer cmd := exec . Command ( viper . GetString ( " " ) , args ... ) log . Debugf ( " " , cmd . Args ) cmd . Stdout = & outbuf cmd . Stderr = & errbuf var err = cmd . Run ( ) log . Debugf ( " " ) result . Stdout = strings . Trim ( outbuf . String ( ) , " " ) result . Stderr = strings . Trim ( errbuf . String ( ) , " " ) if err != nil { if exitError , ok := err . ( * exec . ExitError ) ; ok { result . ExitCode = exitError . Sys ( ) . ( syscall . WaitStatus ) . ExitStatus ( ) } else { if result . Stderr == " " { result . Stderr = err . Error ( ) } } } return result , err }
RunHelmCommand runs the given command against helm
RunHelmCommand runs the given command against helm
// // This crafty snippet is from https://stackoverflow.com/questions/10385551/get-exit-code-go //