Skip to content

Fix issue 2601 (dont fail on empty /nix folder) #2605

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

Merged
merged 1 commit into from
Jul 7, 2025

Conversation

ascknx
Copy link
Contributor

@ascknx ascknx commented Apr 29, 2025

Summary

Fix for #2601

How was it tested?

  1. created empty /nix folder
  2. devbox succeeds now installing nix

Community Contribution License

All community contributions in this pull request are licensed to the project
maintainers under the terms of the
Apache 2 License.

By creating this pull request, I represent that I have the right to license the
contributions to the project maintainers under the Apache 2 License as stated in
the
Community Contribution License.

@Lagoja Lagoja requested a review from mikeland73 July 2, 2025 17:42
Copy link
Contributor

@mikeland73 mikeland73 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor non-blocking nit. I'll merge this to get it into next release.

func IsDirEmpty(path string) bool {
entries, err := os.ReadDir(path)
if err != nil {
return false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think returning false on error is a bit confusing (is it not empty if it doesn't exist?)

IsDirEmpty could return the error as well and dirExistsAndIsNotEmpty handles the error and returns a single bool

@mikeland73 mikeland73 merged commit 8237a2a into jetify-com:main Jul 7, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants