// GetDockerComposeVersion runs docker-compose -v to get the current version
GetDockerComposeVersion runs docker-compose -v to get the current version
// GetDockerComposeVersion runs docker - compose - v to get the current version
func GetDockerComposeVersion() (string, error) {
	if DockerComposeVersion != "" {
		return DockerComposeVersion, nil
	}
	executableName := "docker-compose"
	path, err := exec.LookPath(executableName)
	if err != nil {
		return "", fmt.Errorf("no docker-compose")
	}
	if runtime.GOOS != "darwin" {
		DockerComposeVersion = "1.25.0-rc4"
		return DockerComposeVersion, nil
	}
	out, err := exec.Command(path, "version", "--short").Output()
	if err != nil {
		return "", err
	}
	v := string(out)
	DockerComposeVersion = strings.TrimSpace(v)
	return DockerComposeVersion, nil
}
func GetDockerComposeVersion ( ) ( string , error ) { if DockerComposeVersion != " " { return DockerComposeVersion , nil } executableName := " " path , err := exec . LookPath ( executableName ) if err != nil { return " " , fmt . Errorf ( " " ) } if runtime . GOOS != " " { DockerComposeVersion = " " return DockerComposeVersion , nil } out , err := exec . Command ( path , " " , " " ) . Output ( ) if err != nil { return " " , err } v := string ( out ) DockerComposeVersion = strings . TrimSpace ( v ) return DockerComposeVersion , nil }
GetDockerComposeVersion runs docker-compose -v to get the current version
GetDockerComposeVersion runs docker - compose - v to get the current version
// Temporarily fake the docker-compose check on macOS because of // the slow docker-compose problem in https://github.com/docker/compose/issues/6956 // This can be removed when that's resolved.