summaryrefslogtreecommitdiff
path: root/redo.hs
diff options
context:
space:
mode:
Diffstat (limited to 'redo.hs')
-rw-r--r--redo.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/redo.hs b/redo.hs
index 927aecf..f0e816a 100644
--- a/redo.hs
+++ b/redo.hs
@@ -10,7 +10,7 @@ import Data.Maybe (listToMaybe)
import GHC.IO.Exception (IOErrorType(..))
import System.Directory (renameFile, removeFile, doesFileExist, getDirectoryContents, removeDirectoryRecursive, createDirectoryIfMissing, getCurrentDirectory, setCurrentDirectory)
import System.Environment (getArgs, getEnvironment, getProgName, lookupEnv)
-import System.Exit (ExitCode(..))
+import System.Exit (ExitCode(..), exitWith)
import System.FilePath (hasExtension, replaceBaseName, takeBaseName, (</>), splitFileName)
import System.IO (hPutStrLn, stderr, hGetLine, withFile, IOMode(..), hFileSize)
import System.IO.Error (ioeGetErrorType, isDoesNotExistError)
@@ -41,7 +41,7 @@ redo target dir = do
unless upToDate' $ maybe missingDo redo' =<< doPath target
where redo' :: FilePath -> IO ()
redo' path = do
- hPutStrLn stderr $ "redo " ++ show (dir </> target)
+ hPutStrLn stderr $ "redo " ++ (if dir == "./" then "" else dir) ++ target
catchJust (guard . isDoesNotExistError)
(removeDirectoryRecursive metaDepsDir)
(\_ -> return ())
@@ -59,6 +59,7 @@ redo target dir = do
else removeFile tmp
ExitFailure code -> do hPutStrLn stderr $ "Redo script exited with non-zero exit code: " ++ show code
removeFile tmp
+ exitWith $ ExitFailure code
tmp = target ++ "---redoing"
metaDepsDir = metaDir </> target
missingDo = do