Skip to content

Commit

Permalink
Re-export WalkMode, it's used on non-mac filewatching backends
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Soltis authored and Greg Soltis committed May 8, 2023
1 parent 914c832 commit ae36eb7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cli/internal/fs/copy_file.go
Expand Up @@ -14,14 +14,14 @@ import (
// It's implemented over github.com/karrick/godirwalk but the provided interface doesn't use that
// to make it a little easier to handle.
func Walk(rootPath string, callback func(name string, isDir bool) error) error {
return walkMode(rootPath, func(name string, isDir bool, mode os.FileMode) error {
return WalkMode(rootPath, func(name string, isDir bool, mode os.FileMode) error {
return callback(name, isDir)
})
}

// walkMode is like Walk but the callback receives an additional type specifying the file mode type.
// WalkMode is like Walk but the callback receives an additional type specifying the file mode type.
// N.B. This only includes the bits of the mode that determine the mode type, not the permissions.
func walkMode(rootPath string, callback func(name string, isDir bool, mode os.FileMode) error) error {
func WalkMode(rootPath string, callback func(name string, isDir bool, mode os.FileMode) error) error {
return godirwalk.Walk(rootPath, &godirwalk.Options{
Callback: func(name string, info *godirwalk.Dirent) error {
// currently we support symlinked files, but not symlinked directories:
Expand Down

0 comments on commit ae36eb7

Please sign in to comment.