pipe: join replaced paths with original path

When saving `/`, it was replaced with the contents, but without the
proper path. So `/` was replaced by [`boot`, `bin`, `home`, ...], but
without prefixing the entry name with the proper path.
This commit is contained in:
Alexander Neumann 2016-02-07 22:18:37 +01:00
parent 6a5b022939
commit 9048eb676b

View file

@ -174,7 +174,16 @@ func cleanupPath(path string) ([]string, error) {
return []string{path}, nil return []string{path}, nil
} }
return readDirNames(path) paths, err := readDirNames(path)
if err != nil {
return nil, err
}
for i, p := range paths {
paths[i] = filepath.Join(path, p)
}
return paths, nil
} }
// Walk sends a Job for each file and directory it finds below the paths. When // Walk sends a Job for each file and directory it finds below the paths. When