Use createDirectoryIfMissing to create the vhdl directory, as it can create the paren...
authorChristiaan Baaij <christiaan.baaij@gmail.com>
Sun, 2 Aug 2009 19:07:46 +0000 (21:07 +0200)
committerChristiaan Baaij <christiaan.baaij@gmail.com>
Sun, 2 Aug 2009 19:07:46 +0000 (21:07 +0200)
cλash/CLasH/Translator.hs
cλash/clash.cabal

index 7ea489f7d2a439926cb8d0376978841c46b57cc9..8f2c7dc98d2b05e7bc7bd2ea6baa71a95cb7ac9f 100644 (file)
@@ -4,7 +4,7 @@ module CLasH.Translator
   ) where
 
 -- Standard Modules
-import qualified Directory
+import qualified System.Directory as Directory
 import qualified Maybe
 import qualified Monad
 import qualified System.FilePath as FilePath
@@ -114,8 +114,7 @@ moduleToVHDL env cores top init test stateful = do
 prepareDir :: String -> IO()
 prepareDir dir = do
   -- Create the dir if needed
-  exists <- Directory.doesDirectoryExist dir
-  Monad.unless exists $ Directory.createDirectory dir
+  Directory.createDirectoryIfMissing True dir
   -- Find all .vhdl files in the directory
   files <- Directory.getDirectoryContents dir
   let to_remove = filter ((==".vhdl") . FilePath.takeExtension) files
index fb44457a57412eb5ff90f8034096f6c7b54684d6..459be313ebe343b217787e31aac51792e031d14b 100644 (file)
@@ -20,7 +20,7 @@ Library
   build-depends:    ghc >= 6.11, pretty, vhdl > 0.1, haskell98, syb,
                     data-accessor, containers, base >= 4, transformers,
                     filepath, template-haskell, data-accessor-template,
-                    prettyclass
+                    prettyclass, directory
                     
   exposed-modules:  CLasH.Translator
                     CLasH.Translator.Annotations