Skip to content
Browse files

Extract package names from either directories (i.e. the package direc…

…tory itself) or a path to a file in a package directory.
  • Loading branch information...
1 parent c2e4eae commit d2773f993dc9f1588c469b6f89c948d8733aff01 Anthony Cowley committed Jul 30, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 Ros/Core/PathUtil.hs
View
3 Ros/Core/PathUtil.hs
@@ -20,7 +20,8 @@ isStack = doesFileExist . (</> "stack.xml")
-- |Identify the name of the package defining a msg.
pathToPkgName :: FilePath -> String
-pathToPkgName = cap . last . init . splitPath
+pathToPkgName p | hasExtension p = cap . last . init . splitPath $ p
+ | otherwise = cap . last . splitPath $ p
-- |Identify the name of the stack in which a msg is defined. If the
-- package definining the message does not live in a stack, the result

0 comments on commit d2773f9

Please sign in to comment.
Something went wrong with that request. Please try again.