mirror of
https://github.com/commercialhaskell/stackage.git
synced 2026-01-24 05:01:56 +01:00
etc/diskspace: include dir in error when more than one subdir
[skip ci]
This commit is contained in:
parent
e9b705d346
commit
c322900508
@ -98,10 +98,14 @@ withOneDirectory_ act = do
|
|||||||
ls <- listDirectory "."
|
ls <- listDirectory "."
|
||||||
case ls of
|
case ls of
|
||||||
[l] -> withCurrentDirectory l act
|
[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
|
withOneDirectory act = do
|
||||||
ls <- listDirectory "."
|
ls <- listDirectory "."
|
||||||
case ls of
|
case ls of
|
||||||
[l] -> withCurrentDirectory l $ act l
|
[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
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user