From d9c864d3c53401e881ee608a020d5018b76320c3 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Fri, 14 Aug 2020 22:07:39 +0200 Subject: [PATCH] Make sure cabal is executable wrt #46 --- lib/GHCup.hs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/GHCup.hs b/lib/GHCup.hs index 8a66fdb..1fbf287 100644 --- a/lib/GHCup.hs +++ b/lib/GHCup.hs @@ -275,10 +275,20 @@ installCabalBindist dlinfo ver (PlatformRequest {..}) = do let cabalFile = [rel|cabal|] liftIO $ createDirRecursive newDirPerms inst destFileName <- lift $ parseRel (toFilePath cabalFile <> "-" <> verToBS ver) + let destPath = inst destFileName handleIO (throwE . CopyError . show) $ liftIO $ copyFile (path cabalFile) - (inst destFileName) + (destPath) Overwrite + liftIO $ setFileMode + (toFilePath destPath) + ( newFilePerms + `unionFileModes` ownerExecuteMode + `unionFileModes` groupExecuteMode + `unionFileModes` otherExecuteMode + ) + + -- | Installs cabal into @~\/.ghcup\/bin/cabal-\@ and