Merge branch 'PR/fix-109'
This commit is contained in:
commit
d4bcf7021e
13
lib/GHCup.hs
13
lib/GHCup.hs
@ -1314,12 +1314,17 @@ upgradeGHCup dls mtarget force pfreq = do
|
|||||||
tmp <- lift withGHCupTmpDir
|
tmp <- lift withGHCupTmpDir
|
||||||
let fn = [rel|ghcup|]
|
let fn = [rel|ghcup|]
|
||||||
p <- liftE $ download dli tmp (Just fn)
|
p <- liftE $ download dli tmp (Just fn)
|
||||||
let fullDest = fromMaybe (binDir </> fn) mtarget
|
let destDir = dirname destFile
|
||||||
liftIO $ hideError NoSuchThing $ deleteFile fullDest
|
destFile = fromMaybe (binDir </> fn) mtarget
|
||||||
|
lift $ $(logDebug) [i|mkdir -p #{toFilePath destDir}|]
|
||||||
|
liftIO $ createDirRecursive' destDir
|
||||||
|
lift $ $(logDebug) [i|rm -f #{toFilePath destFile}|]
|
||||||
|
liftIO $ hideError NoSuchThing $ deleteFile destFile
|
||||||
|
lift $ $(logDebug) [i|cp #{toFilePath p} #{toFilePath destFile}|]
|
||||||
handleIO (throwE . CopyError . show) $ liftIO $ copyFile p
|
handleIO (throwE . CopyError . show) $ liftIO $ copyFile p
|
||||||
fullDest
|
destFile
|
||||||
Overwrite
|
Overwrite
|
||||||
lift $ chmod_755 fullDest
|
lift $ chmod_755 destFile
|
||||||
pure latestVer
|
pure latestVer
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user