Permalink
Browse files

Fixed 'roshask dep' error on exit when current package does not have …

…a msg directory.
  • Loading branch information...
1 parent 6dcbe6c commit 94f18b26f495febd35bca7dde54e9b2e39749ade Anthony Cowley committed Sep 26, 2011
Showing with 7 additions and 2 deletions.
  1. +7 −2 Ros/Core/Build/DepFinder.hs
@@ -108,8 +108,13 @@ findPackageDepNames pkgRoot =
-- |Returns 'True' if the ROS package at the given 'FilePath' defines
-- any messages.
hasMsgs :: FilePath -> IO Bool
-hasMsgs pkgPath = not . null . filter ((== ".msg") . takeExtension) <$>
- getDirectoryContents (pkgPath </> "msg")
+hasMsgs pkgPath =
+ do e <- doesDirectoryExist msgPath
+ if e
+ then not . null . filter ((== ".msg") . takeExtension) <$>
+ getDirectoryContents msgPath
+ else return False
+ where msgPath = pkgPath </> "msg"
{-
-- |Returns 'True' if the ROS package at the given 'FilePath' is a

0 comments on commit 94f18b2

Please sign in to comment.