Compare commits
1 Commits
error-hand
...
issue-716
| Author | SHA1 | Date | |
|---|---|---|---|
|
2783b8f693
|
@@ -452,7 +452,7 @@ install installCommand settings getAppState' runLogger = case installCommand of
|
|||||||
(_tvVersion -> v, vi) <- liftE $ fromVersion instVer HLS
|
(_tvVersion -> v, vi) <- liftE $ fromVersion instVer HLS
|
||||||
-- TODO: support legacy
|
-- TODO: support legacy
|
||||||
liftE $ runBothE' (installHLSBindist
|
liftE $ runBothE' (installHLSBindist
|
||||||
(DownloadInfo uri (Just $ RegexDir "haskell-language-server-*") "")
|
(DownloadInfo uri (if isWindows then Nothing else Just (RegexDir "haskell-language-server-*")) "")
|
||||||
v
|
v
|
||||||
(maybe GHCupInternal IsolateDir isolateDir)
|
(maybe GHCupInternal IsolateDir isolateDir)
|
||||||
forceInstall
|
forceInstall
|
||||||
|
|||||||
@@ -465,22 +465,15 @@ withGHCupTmpDir :: ( MonadReader env m
|
|||||||
, MonadMask m
|
, MonadMask m
|
||||||
, MonadIO m)
|
, MonadIO m)
|
||||||
=> m GHCupPath
|
=> m GHCupPath
|
||||||
withGHCupTmpDir = do
|
withGHCupTmpDir = snd <$> withRunInIO (\run ->
|
||||||
Settings{keepDirs} <- getSettings
|
run
|
||||||
snd <$> withRunInIO (\run ->
|
$ allocate
|
||||||
run
|
(run mkGhcupTmpDir)
|
||||||
$ allocate
|
(\fp ->
|
||||||
(run mkGhcupTmpDir)
|
handleIO (\e -> run
|
||||||
(\fp -> if -- we don't know whether there was a failure, so can only
|
$ logDebug ("Resource cleanup failed for " <> T.pack (fromGHCupPath fp) <> ", error was: " <> T.pack (displayException e)))
|
||||||
-- decide for 'Always'
|
. removePathForcibly
|
||||||
| keepDirs == Always -> pure ()
|
$ fp))
|
||||||
| otherwise -> handleIO (\e -> run
|
|
||||||
$ logDebug ("Resource cleanup failed for "
|
|
||||||
<> T.pack (fromGHCupPath fp)
|
|
||||||
<> ", error was: "
|
|
||||||
<> T.pack (displayException e)))
|
|
||||||
. removePathForcibly
|
|
||||||
$ fp))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user