Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Commit 39e5c3c

Browse files
committed
use strict copyFile function for hie-x.y binaries
1 parent 4167153 commit 39e5c3c

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

install/src/Cabal.hs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ import Development.Shake.FilePath
66
import Control.Monad
77
import Data.Maybe ( isNothing )
88
import Control.Monad.Extra ( whenMaybe )
9-
import System.Directory ( findExecutable )
9+
import System.Directory ( findExecutable
10+
, copyFile
11+
)
1012

1113
import Version
1214
import Print
@@ -45,10 +47,11 @@ cabalInstallHie versionNumber = do
4547
, "exe:hie"
4648
, "--overwrite-policy=always"
4749
]
48-
copyFile' (localBin </> "hie" <.> exe)
49-
(localBin </> "hie-" ++ versionNumber <.> exe)
50-
copyFile' (localBin </> "hie" <.> exe)
51-
(localBin </> "hie-" ++ dropExtension versionNumber <.> exe)
50+
liftIO $ do
51+
copyFile (localBin </> "hie" <.> exe)
52+
(localBin </> "hie-" ++ versionNumber <.> exe)
53+
copyFile (localBin </> "hie" <.> exe)
54+
(localBin </> "hie-" ++ dropExtension versionNumber <.> exe)
5255

5356
-- TODO: review
5457
installCabal :: Action ()

install/src/Stack.hs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import Development.Shake
44
import Development.Shake.Command
55
import Development.Shake.FilePath
66
import Control.Monad
7+
import System.Directory ( copyFile )
78

89
import Version
910
import Print
@@ -18,12 +19,13 @@ stackBuildHie versionNumber = execStackWithGhc_ versionNumber ["build"]
1819
stackInstallHie :: VersionNumber -> Action ()
1920
stackInstallHie versionNumber = do
2021
execStackWithGhc_ versionNumber ["install"]
21-
localBinDir <- getLocalBin
22+
localBinDir <- getLocalBin
2223
let hie = "hie" <.> exe
23-
copyFile' (localBinDir </> hie)
24-
(localBinDir </> "hie-" ++ versionNumber <.> exe)
25-
copyFile' (localBinDir </> hie)
26-
(localBinDir </> "hie-" ++ dropExtension versionNumber <.> exe)
24+
liftIO $ do
25+
copyFile (localBinDir </> hie)
26+
(localBinDir </> "hie-" ++ versionNumber <.> exe)
27+
copyFile (localBinDir </> hie)
28+
(localBinDir </> "hie-" ++ dropExtension versionNumber <.> exe)
2729

2830
buildCopyCompilerTool :: VersionNumber -> Action ()
2931
buildCopyCompilerTool versionNumber =

0 commit comments

Comments
 (0)