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

Safely handle missing credentials.d folder #27

Merged
merged 1 commit into from
Aug 28, 2023

Conversation

bltavares
Copy link
Contributor

The $HOME/.aws/credentials.d folder is not required to exist, as all credential configurations can be defined on $HOME/.aws/credentials instead.

The early return with the ? operator caused the binary to fail if the optional folder did not exist, but worked if the folder existed but was empty.

This commit refactors the code the avoid crashing when the $HOME/.aws/credentials.d does not exist.

It is collecting into a Vector instead of chaining the streams as it would required Boxed Streams to switch between ReadDirStream and stream::empty in case of an Err.

This fixes #26

The `$HOME/.aws/credentials.d` folder is not required to exist, as all
credential configurations can be defined on `$HOME/.aws/credentials` instead.

The early return with the `?` operator caused the binary to fail if the
optional folder did not exist, but worked if the folder existed but was empty.

This commit refactors the code the avoid crashing when the
`$HOME/.aws/credentials.d` does not exist.

It is collecting into a Vector instead of chaining the streams as it would
required Boxed Streams to switch between `ReadDirStream` and `stream::empty` in
case of an `Err`.
@naftulikay naftulikay merged commit 9984069 into naftulikay:master Aug 28, 2023
1 check passed
@naftulikay
Copy link
Owner

@bltavares Thank you so much for your fix here! I haven't had much time to fix this nagging issue and I and other users are very grateful for your work. I will be releasing 2.0.1 shortly to include this fix and will mention you in the release notes.

@bltavares
Copy link
Contributor Author

No problem at all. I'm glad to help :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MacOS: binary not working
2 participants