INNER CODE UNIT · Go
detectProtocol
lmorg/murex · builtins/core/modules/cmd.go:75
func detectProtocol(uri string) (string, error) {
switch {
case strings.HasPrefix(uri, "http://"):
return "", errors.New("for security reasons, downloading packages is not allowed over plain text http. Please use `https://` instead")
case strings.HasSuffix(uri, ".git"):
return "git", nil
case strings.HasPrefix(uri, "https://"):
return "https", nil
default:
return "", errors.New("unable to get package: Unable to auto-detect a suitable protocol for transferring the package")
}
}
func cdPackage(p *lang.Process) error {
modulePath := profilepaths.ModulePath()