Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix vendor pull error message #940

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion internal/exec/vendor_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,16 @@ func ReadAndProcessVendorConfigFile(
// Check if it's a directory
fileInfo, err := os.Stat(foundVendorConfigFile)
if err != nil {
return vendorConfig, false, "", err
if os.IsNotExist(err) {
// File does not exist
return vendorConfig, false, "", fmt.Errorf("Vendoring is not configured. To set up vendoring, please see https://atmos.tools/core-concepts/vendor/")
}
if os.IsPermission(err) {
// Permission error
return vendorConfig, false, "", fmt.Errorf("Permission denied when accessing '%s'. Please check the file permissions.", foundVendorConfigFile)
}
// Other errors
return vendorConfig, false, "", fmt.Errorf("An error occurred while accessing the vendoring configuration: %w", err)
}

var configFiles []string
Expand Down
13 changes: 13 additions & 0 deletions tests/test-cases/vendor-test.yaml
aknysh marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
tests:
- name: atmos vendor pull
enabled: true
description: ""
workdir: "../"
command: "atmos"
args:
- "vendor"
- "pull"
expect:
stderr:
- "Vendoring is not configured. To set up vendoring please see https://atmos.tools/core-concepts/vendor/"
exit_code: 1
Loading