import: Preserve top-level directory structure.

This commit is contained in:
Joey Hess 2013-09-25 13:16:55 -04:00
parent 9cae3a21f6
commit c923c981b9
3 changed files with 4 additions and 4 deletions

View file

@ -60,7 +60,7 @@ withPathContents :: ((FilePath, FilePath) -> CommandStart) -> CommandSeek
withPathContents a params = map a . concat <$> liftIO (mapM get params)
where
get p = ifM (isDirectory <$> getFileStatus p)
( map (\f -> (f, makeRelative p f)) <$> dirContentsRecursive p
( map (\f -> (f, makeRelative (parentDir p) f)) <$> dirContentsRecursive p
, return [(p, takeFileName p)]
)