Skip to content

Commit

Permalink
Fix source loader path trimming
Browse files Browse the repository at this point in the history
  • Loading branch information
evanpurkhiser committed Jul 3, 2018
1 parent 786267e commit 2bfa5c8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions resolver/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,21 +189,21 @@ func resolveRemoved(dotfiles dotfileMap, oldDotfiles []string) {
}

// sourceLoader provides a list of files given a source path.
var sourceLoader = func(path string) []string {
var sourceLoader = func(sourcePath string) []string {
sources := []string{}

walker := func(path string, info os.FileInfo, err error) error {
if err != nil || info.IsDir() {
return nil
}

srcPath := strings.TrimPrefix(path, path+separator)
srcPath := strings.TrimPrefix(path, sourcePath+separator)
sources = append(sources, srcPath)

return nil
}

filepath.Walk(path, walker)
filepath.Walk(sourcePath, walker)

return sources
}
Expand Down

0 comments on commit 2bfa5c8

Please sign in to comment.