in schema/v1/short_reference.go [89:110]
func pathFilename(allowAbsolute bool, pathStr string) ([]string, string) {
filename := "step.yml"
if pathStr == "" {
return nil, filename
}
path := strings.Split(pathStr, "/")
lastItemIndex := len(path) - 1
if strings.HasSuffix(path[lastItemIndex], ".yml") {
filename = path[lastItemIndex]
path = path[:lastItemIndex]
}
if allowAbsolute && len(path) > 0 && strings.HasPrefix(pathStr, "/") {
// for absolute paths, strings.Split results in the first element of path being empty string
path[0] = "/"
}
path = slices.DeleteFunc(path, func(value string) bool { return value == "" })
return path, filename
}