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

Adds flag in 'ListFiles' to skip over empty directories. Closes #53 #54

Merged

Conversation

binaek
Copy link
Contributor

@binaek binaek commented Jun 8, 2023

No description provided.

@binaek binaek added the enhancement New feature or request label Jun 8, 2023
@binaek binaek requested a review from kaidaguerre June 8, 2023 11:58
@binaek binaek self-assigned this Jun 8, 2023
@binaek binaek linked an issue Jun 8, 2023 that may be closed by this pull request
files/list.go Outdated
if opts.Flags&NotEmpty != 0 {
ls, err := os.ReadDir(filePath)
if err != nil {
// if we can't read the contents
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's try to avoid needlessly multiline comments

// if dir read fails, skip this directory since the listing code will probably also fail to read it

Copy link
Contributor

Choose a reason for hiding this comment

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

// if we can't read the conten

@kaidaguerre kaidaguerre self-requested a review June 8, 2023 16:23
files/list.go Outdated
if opts.Flags&NotEmpty != 0 {
ls, err := os.ReadDir(filePath)
if err != nil {
// if we can't read the contents
Copy link
Contributor

Choose a reason for hiding this comment

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

// if we can't read the conten

@kaidaguerre kaidaguerre merged commit a959234 into main Jun 8, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ability to skip over empty directories in ListFiles
2 participants