Skip to content
Snippets Groups Projects
Verified Commit d4bcf702 authored by Julian Ospald's avatar Julian Ospald :tea:
Browse files

Merge branch 'PR/fix-109'

parents e5a60d1b d82e189c
No related branches found
No related tags found
1 merge request!64Fix failed ghcup upgrade if destination dir doesn't exist
Pipeline #31401 passed
......@@ -1314,12 +1314,17 @@ upgradeGHCup dls mtarget force pfreq = do
tmp <- lift withGHCupTmpDir
let fn = [rel|ghcup|]
p <- liftE $ download dli tmp (Just fn)
let fullDest = fromMaybe (binDir </> fn) mtarget
liftIO $ hideError NoSuchThing $ deleteFile fullDest
let destDir = dirname destFile
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
fullDest
destFile
Overwrite
lift $ chmod_755 fullDest
lift $ chmod_755 destFile
pure latestVer
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment