func GetGitRepo(gitURL string) (repository string) {
	if strings.Contains(gitURL, "github.com/") {
		u, err := url.Parse(gitURL)
		if err != nil {
			return
		}
		repository = strings.TrimPrefix(u.Path, "/")
	} else {
		items := gitURLPattern.FindStringSubmatch(gitURL)
		if len(items) > 1 {
			repository = items[1]
		}
	}
	return repository
}
GetGitRepo Parse repository name from URL
package utils
import (
	"log"
	"net/url"
	"os"
	"path/filepath"
	"regexp"
	"runtime"
	"strings"
	"unicode"
	"github.com/howeyc/gopass"
)
var gitURLPattern = regexp.MustCompile(`([^/]*)(?:.git)`)
func Contains(haystack []string, needle string) bool {
	for _, item := range haystack {
		if item == needle {
			return true
		}
	}
	return false
}
func PathMustExist(path string) {
	if fileExists, err := Exists(path); !fileExists {
		if err != nil {
			log.Fatal(errInvalidPath)
		}
	}
}
func GetConfigDir() (configDir string) {
	if strings.HasSuffix(os.Args[0], ".test") {  
		return ".." + string(os.PathSeparator) + ".." + string(os.PathSeparator) + "config" + string(os.PathSeparator)
	}
	userHomeDir, err := os.UserHomeDir()
	if err != nil {
		log.Fatal("Home directory doesn't exist", err)
	}
	cwd := MustGetED()
	overrideDir := string(os.PathSeparator) + ebConfFileDir + string(os.PathSeparator)
	localOverrideDir := cwd + overrideDir
	localOverrideFileCheck := localOverrideDir + ebConfFileName
	if fe, _ := Exists(localOverrideFileCheck); fe {
		configDir = localOverrideDir
		log.Println("Using local config directory: ", localOverrideDir)
	} else {
		switch runtime.GOOS {
		case "windows":
			configDir += ebWinConfFileDir
		case "linux":  
			configDir += overrideDir
		case "darwin":
			configDir += overrideDir
		}
		configDir = userHomeDir + configDir
	}
	return configDir
}
func MustGetED() string {
	ex, err := os.Executable()
	if err != nil {
		log.Fatal(err)
	}
	return filepath.Dir(ex)
}
func MustGetWD() string {
	cwd, err := os.Getwd()
	if err != nil {
		log.Fatal(err)
	}
	return cwd
}
func GetTargetType(GitStagedFlag, GitTrackedFlag bool) (targetType string) {
	if GitStagedFlag {
		targetType = Staged
	} else if GitTrackedFlag {
		targetType = Tracked
	} else {
		targetType = All
	}
	return targetType
}
func GetEnabledModulesMap(enableFlags []string, availableModules map[string]string) (enabledModules map[string]string) {
	enabledModules = make(map[string]string)
	if len(enableFlags) == 0 {
		return availableModules
	}
	for _, moduleName := range enableFlags {
		enabledModules[moduleName] = availableModules[moduleName]
	}
	return enabledModules
}
func GetDisplayList(levelNames []string) string {
	return "[ " + strings.Join(levelNames, " | ") + " ]"
}
func DeleteGit(ptrRepo string, path string) {
	if ptrRepo != "" {
		err := os.RemoveAll(path)
		if err != nil {
			log.Println(errGitDelete, err)
		}
	}
}