diff --git a/etc/diskspace/remove-old-stack-work-libs.hs b/etc/diskspace/remove-old-stack-work-libs.hs index bdb8ada0..6628fb08 100755 --- a/etc/diskspace/remove-old-stack-work-libs.hs +++ b/etc/diskspace/remove-old-stack-work-libs.hs @@ -98,10 +98,14 @@ withOneDirectory_ act = do ls <- listDirectory "." case ls of [l] -> withCurrentDirectory l act - _ -> error $ "more than one directory found: " ++ unwords ls + _ -> do + cwd <- getCurrentDirectory + error $ "more than one directory found in " ++ cwd ++ ": " ++ unwords ls withOneDirectory act = do ls <- listDirectory "." case ls of [l] -> withCurrentDirectory l $ act l - _ -> error $ "more than one directory found: " ++ unwords ls + _ -> do + cwd <- getCurrentDirectory + error $ "more than one directory found in " ++ cwd ++ ": " ++ unwords ls