mirror of
https://github.com/commercialhaskell/stackage.git
synced 2026-01-11 23:08:30 +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 "."
|
||||
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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user