diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-01-14 17:56:21 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-01-14 17:56:21 -0400 |
commit | 09973ef89e8ed98bf520b2956c05aa83db786ca9 (patch) | |
tree | 9269c3af0e7c49371d8584d5d1ef847bf1fe6689 /Build | |
parent | e3988a7855e0abe5880f0c1eb8d0c7ff111e8ec0 (diff) |
throw exception if library copy fails
Diffstat (limited to 'Build')
-rw-r--r-- | Build/OSXMkLibs.hs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Build/OSXMkLibs.hs b/Build/OSXMkLibs.hs index da98d29d6..80f24a681 100644 --- a/Build/OSXMkLibs.hs +++ b/Build/OSXMkLibs.hs @@ -12,6 +12,7 @@ import Data.Maybe import System.FilePath import System.Directory import Control.Monad +import Control.Monad.IfElse import Data.List import Data.String.Utils import Control.Applicative @@ -53,9 +54,10 @@ installLibs appbase replacement_libs libmap = do , do createDirectoryIfMissing True (parentDir dest) putStrLn $ "installing " ++ pathlib ++ " as " ++ shortlib - _ <- boolSystem "cp" [File pathlib, File dest] - _ <- boolSystem "chmod" [Param "644", File dest] - _ <- boolSystem "ln" [Param "-s", File fulllib, File symdest] + unlessM (boolSystem "cp" [File pathlib, File dest] + <&&> boolSystem "chmod" [Param "644", File dest] + <&&> boolSystem "ln" [Param "-s", File fulllib, File symdest]) $ + error "library install failed" return $ Just appbase ) return (catMaybes libs, replacement_libs', libmap') |