Skip to content

Commit

Permalink
Better error message and use compat listDirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
fendor committed Jun 18, 2019
1 parent 320b6e0 commit 4e6c2fe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cabal-install/Distribution/Client/Get.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ module Distribution.Client.Get (

import Prelude ()
import Distribution.Client.Compat.Prelude hiding (get)

import Distribution.Compat.Directory
( listDirectory )
import Distribution.Package
( PackageId, packageId, packageName )
import Distribution.Simple.Setup
Expand Down Expand Up @@ -56,8 +57,7 @@ import Control.Monad
( mapM, forM_, mapM_, unless )
import qualified Data.Map as Map
import System.Directory
( createDirectoryIfMissing, doesDirectoryExist, doesFileExist
, listDirectory )
( createDirectoryIfMissing, doesDirectoryExist, doesFileExist )
import System.Exit
( ExitCode(..) )
import System.FilePath
Expand Down Expand Up @@ -172,7 +172,7 @@ unpackPackage verbosity prefix pkgid descOverride pkgPath = do
isEmpty <- emptyDirectory pkgdir
unless isEmpty $
die' verbosity $
"The directory \"" ++ pkgdir' ++ "\" already exists, not unpacking."
"The directory \"" ++ pkgdir' ++ "\" already exists and is not empty, not unpacking."
existsFile <- doesFileExist pkgdir
when existsFile $ die' verbosity $
"A file \"" ++ pkgdir ++ "\" is in the way, not unpacking."
Expand Down

0 comments on commit 4e6c2fe

Please sign in to comment.