func makeRelativePath()

in initiatehandler.go [26:37]


func makeRelativePath(inputPath string, config *helpers.Config) (string, error) {
	serverSidePathConverter := regexp.MustCompile("^/Volumes")
	potentialPaths := []string{inputPath, serverSidePathConverter.ReplaceAllString(inputPath, "/srv")}

	for _, path := range potentialPaths {
		if strings.HasPrefix(path, config.StoragePrefix.LocalPath) {
			return path[len(config.StoragePrefix.LocalPath):], nil
		}
	}
	return "", errors.New("invalid destination path, please check the settings")

}