func PluginInstalled(plugin string) (bool, error) {
	var err error
	var output []string
	var res Result

	// Get a list of currently installed plugins
	res, err = RunHelmCommand("plugin", "list")
	if err != nil {
		fmt.Println(strings.TrimSpace(res.Stderr))
		return false, err
	}

	// Split the output on the new line
	output = strings.Split(res.Stdout, "\n")

	// Remove the column titles
	if len(output) > 0 {
		output = output[1:]
	}

	// Iterate the plugins
	for _, line := range output {
		if len(line) == 0 {
			continue
		}

		// Split the string by a space
		split := strings.Fields(line)

		if plugin == split[0] {
			return true, nil
		}
	}

	return false, nil
}
// PluginInstalled returns if the given plugin is installed
PluginInstalled returns if the given plugin is installed
// PluginInstalled returns if the given plugin is installed
func PluginInstalled(plugin string) (bool, error) {
	var err error
	var output []string
	var res Result
	res, err = RunHelmCommand("plugin", "list")
	if err != nil {
		fmt.Println(strings.TrimSpace(res.Stderr))
		return false, err
	}
	output = strings.Split(res.Stdout, "\n")
	if len(output) > 0 {
		output = output[1:]
	}
	for _, line := range output {
		if len(line) == 0 {
			continue
		}
		split := strings.Fields(line)
		if plugin == split[0] {
			return true, nil
		}
	}
	return false, nil
}
func PluginInstalled ( plugin string ) ( bool , error ) { var err error var output [ ] string var res Result res , err = RunHelmCommand ( " " , " " ) if err != nil { fmt . Println ( strings . TrimSpace ( res . Stderr ) ) return false , err } output = strings . Split ( res . Stdout , " \n " ) if len ( output ) > 0 { output = output [ 1 : ] } for _ , line := range output { if len ( line ) == 0 { continue } split := strings . Fields ( line ) if plugin == split [ 0 ] { return true , nil } } return false , nil }
PluginInstalled returns if the given plugin is installed
PluginInstalled returns if the given plugin is installed
// Get a list of currently installed plugins // Split the output on the new line // Remove the column titles // Iterate the plugins // Split the string by a space