func (o *Installer) GetVersion(path string) (version string, err error) {
	var (
		org  string
		repo string
		name string
	)
	var appName string
	appInfo := strings.Split(path, "@")
	switch len(appInfo) {
	case 1:
		appName = appInfo[0]
		version = "latest"
	case 2:
		appName = appInfo[0]
		version = appInfo[1]
	default:
		err = fmt.Errorf("only support format xxx or xxx@version")
		return
	}
	addr := strings.Split(appName, "/")
	if len(addr) >= 2 {
		org = addr[0]
		repo = addr[1]
	} else if len(addr) > 0 {
		repo = addr[0]
		if potentialOrgs := findByRepo(repo); len(potentialOrgs) == 0 {
			err = fmt.Errorf("cannot found the package: %s", repo)
			return
		} else if len(potentialOrgs) == 1 {
			org = potentialOrgs[0]
		} else {
			if org, err = chooseOneFromArray(potentialOrgs); err != nil {
				err = fmt.Errorf("failed to choose the potential organizations of your desired package")
				return
			}
		}
		fmt.Printf("target package is %s/%s\n", org, repo)
	} else {
		err = fmt.Errorf("name only support format xx, xx/xx or xx/xx/xx")
		return
	}
	if len(addr) == 3 {
		name = addr[2]
	} else {
		name = repo
	}
	o.Org = org
	o.Repo = repo
	o.Name = name
	return
}
GetVersion parse install app info
package installer
import (
	"bytes"
	"fmt"
	"github.com/AlecAivazis/survey/v2"
	"github.com/linuxsuren/http-downloader/pkg"
	"github.com/linuxsuren/http-downloader/pkg/common"
	"github.com/linuxsuren/http-downloader/pkg/compress"
	"github.com/linuxsuren/http-downloader/pkg/exec"
	"github.com/linuxsuren/http-downloader/pkg/net"
	"github.com/linuxsuren/http-downloader/pkg/os"
	"github.com/mitchellh/go-homedir"
	"gopkg.in/yaml.v2"
	"io/ioutil"
	"net/http"
	"net/url"
	sysos "os"
	"path"
	"path/filepath"
	"runtime"
	"strings"
	"text/template"
)
const (
	ProviderGitHub = "github"
)
func (o *Installer) CheckDepAndInstall(tools map[string]string) (err error) {
	for tool, formula := range tools {
		if _, lookErr := exec.LookPath(tool); lookErr == nil {
			continue
		}
		fmt.Printf("start to install missing tool: %s\n", tool)
		if os.HasPackage(tool) {
			if err = os.Install(tool); err != nil {
				return
			}
			continue
		}
		var targetURL string
		if targetURL, err = o.ProviderURLParse(formula, false); err != nil {
			return
		}
		var urlObj *url.URL
		var output string
		if urlObj, err = url.Parse(targetURL); err == nil {
			if output = path.Base(urlObj.Path); output == "" {
				err = fmt.Errorf("output cannot be empty")
				return
			}
			if err = net.DownloadFileWithMultipleThreadKeepParts(targetURL, output, 4, true, true); err == nil {
				o.CleanPackage = true
				o.Source = output
				if err = o.Install(); err != nil {
					return
				}
			} else {
				return
			}
		} else {
			err = fmt.Errorf("cannot parse the target URL, error: '%v'", err)
		}
	}
	return
}