summaryrefslogtreecommitdiff
path: root/custom/redo.patch
blob: cd3a678e97fbb108ce13b87bf19a8e4198d2246c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/redo.hs b/redo.hs
index f0e816a..01c6a2e 100644
--- a/redo.hs
+++ b/redo.hs
@@ -48,7 +48,12 @@ redo target dir = do
          createDirectoryIfMissing True metaDepsDir
          writeMD5 target path
          oldEnv <- getEnvironment
-         let newEnv = toList $ adjust (++ ":.") "PATH" $ insert "REDO_TARGET" target $ fromList oldEnv
+         redoPath <- lookupEnv "REDO_PATH"
+         let
+           redoPath' = case redoPath of
+             Just p -> p
+             _ -> "."
+           newEnv = toList $ adjust (++ (':' : redoPath')) "PATH" $ insert "REDO_TARGET" target $ fromList oldEnv
          (_, _, _, ph) <- createProcess $ (shell $ cmd path) {env = Just newEnv}
          exit <- waitForProcess ph
          case exit of