aboutsummaryrefslogtreecommitdiff
path: root/src/CabalHelper/Shared/Sandbox.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/CabalHelper/Shared/Sandbox.hs')
-rw-r--r--src/CabalHelper/Shared/Sandbox.hs9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/CabalHelper/Shared/Sandbox.hs b/src/CabalHelper/Shared/Sandbox.hs
index f7b7470..d2172a2 100644
--- a/src/CabalHelper/Shared/Sandbox.hs
+++ b/src/CabalHelper/Shared/Sandbox.hs
@@ -28,11 +28,12 @@ import Data.Maybe
import Data.List
import Data.Version
import System.FilePath
-import System.Directory
import Prelude
import qualified Data.Traversable as T
+import CabalHelper.Shared.Common
+
-- | Get the path to the sandbox package-db in a project
getSandboxPkgDb :: String
-- ^ Cabal build platform, i.e. @buildPlatform@
@@ -68,12 +69,6 @@ extractSandboxDbDir conf = extractValue <$> parse conf
parse = listToMaybe . filter (key `isPrefixOf`) . lines
extractValue = CabalHelper.Shared.Sandbox.dropWhileEnd isSpace . dropWhile isSpace . drop keyLen
-
-mightExist :: FilePath -> IO (Maybe FilePath)
-mightExist f = do
- exists <- doesFileExist f
- return $ if exists then (Just f) else (Nothing)
-
-- dropWhileEnd is not provided prior to base 4.5.0.0.
dropWhileEnd :: (a -> Bool) -> [a] -> [a]
dropWhileEnd p = foldr (\x xs -> if p x && null xs then [] else x : xs) []