@@ -5,7 +5,8 @@ import System.Process
5import System.Directory
5import System.Directory
6import System.Exit
6import System.Exit
7import System.IO
7import System.IO
8−import System.FilePath ((</>), addTrailingPathSeparator, takeFileName, takeDirectory, normalise)
8+import System.FilePath ((</>), addTrailingPathSeparator, takeFileName,
9+ takeDirectory, normalise, addExtension, hasExtension)
9import System.Directory (createDirectoryIfMissing, copyFile)
10import System.Directory (createDirectoryIfMissing, copyFile)
11import Util.System
12import Util.System
@@ -118,7 +119,7 @@ cleanPkg fp
118 rmIdx (pkgname pkgdesc)
119 rmIdx (pkgname pkgdesc)
119 case execout pkgdesc of
120 case execout pkgdesc of
120 Nothing -> return ()
121 Nothing -> return ()
121− Just s -> rmFile $ dir </> s
122+ Just s -> rmExe $ dir </> s
123-- | Generate IdrisDoc for package
124-- | Generate IdrisDoc for package
124-- TODO: Handle case where module does not contain a matching namespace
125-- TODO: Handle case where module does not contain a matching namespace
@@ -231,7 +232,13 @@ rmIBC m = rmFile $ toIBCFile m
231rmIdx :: String -> IO ()
232rmIdx :: String -> IO ()
232rmIdx p = do let f = pkgIndex p
233rmIdx p = do let f = pkgIndex p
233 ex <- doesFileExist f
234 ex <- doesFileExist f
234− when ex $ rmFile f
235+ when ex $ rmFile f
237+rmExe :: String -> IO ()
239+ fn <- return $ if isWindows && not (hasExtension p)
240+ then addExtension p ".exe" else p
236toIBCFile (UN n) = str n ++ ".ibc"
243toIBCFile (UN n) = str n ++ ".ibc"
237toIBCFile (NS n ns) = foldl1' (</>) (reverse (toIBCFile n : map str ns))
244toIBCFile (NS n ns) = foldl1' (</>) (reverse (toIBCFile n : map str ns))