Skip to content

Commit

Permalink
remove validateURI
Browse files Browse the repository at this point in the history
  • Loading branch information
haitham911 committed Jan 21, 2025
1 parent 46edee4 commit 8c6d2e0
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions internal/exec/vendor_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -520,10 +520,10 @@ func determineSourceType(uri *string, vendorConfigFilePath string) (bool, bool,
useLocalFileSystem = true
sourceIsLocalFile = u.FileExists(*uri)
}
u, err := url.Parse(*uri)
if err == nil && u.Scheme != "" {
if u.Scheme == "file" {
trimmedPath := strings.TrimPrefix(filepath.ToSlash(u.Path), "/")
parsedURL, err := url.Parse(*uri)
if err == nil && parsedURL.Scheme != "" {
if parsedURL.Scheme == "file" {
trimmedPath := strings.TrimPrefix(filepath.ToSlash(parsedURL.Path), "/")
*uri = filepath.Clean(trimmedPath)
useLocalFileSystem = true
}
Expand Down Expand Up @@ -621,19 +621,3 @@ func generateSkipFunction(atmosConfig schema.AtmosConfiguration, tempDir string,
return false, nil
}
}

func validateURI(uri string) error {
if uri == "" {
return fmt.Errorf("URI cannot be empty")
}
if strings.Contains(uri, " ") {
return fmt.Errorf("URI cannot contain spaces")
}
// Validate scheme-specific format
if strings.HasPrefix(uri, "oci://") {
if !strings.Contains(uri[6:], "/") {
return fmt.Errorf("invalid OCI URI format")
}
}
return nil
}

0 comments on commit 8c6d2e0

Please sign in to comment.