Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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: 9 additions & 2 deletions packages/envd/internal/services/filesystem/dir.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package filesystem

import (
"context"
"errors"
"fmt"
"os"
"path"
Expand Down Expand Up @@ -135,7 +136,7 @@ func checkIfDirectory(path string) error {

// walkDir walks the directory tree starting from dirPath up to the specified depth (doesn't follow symlinks).
func walkDir(requestedPath string, dirPath string, depth int) (entries []*rpc.EntryInfo, err error) {
err = filepath.WalkDir(dirPath, func(path string, entry os.DirEntry, err error) error {
err = filepath.WalkDir(dirPath, func(path string, _ os.DirEntry, err error) error {
if err != nil {
return err
}
Expand All @@ -157,7 +158,13 @@ func walkDir(requestedPath string, dirPath string, depth int) (entries []*rpc.En
}

entryInfo, err := entryInfo(path)
if entry == nil {
if err != nil {
var notFoundErr *connect.Error
if errors.As(err, &notFoundErr) && notFoundErr.Code() == connect.CodeNotFound {
// Skip entries that don't exist anymore
return nil
}

return err
}

Expand Down
2 changes: 1 addition & 1 deletion packages/envd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const (
)

var (
Version = "0.4.1"
Version = "0.4.2"

commitSHA string

Expand Down
Loading