Commit 9bb58799 authored by Ben Gamari's avatar Ben Gamari 🐢 Committed by Marge Bot

Hadrian: Delete target symlink in createFileLinkUntracked

Previously createFileLinkUntracked would fail if the symlink already
parent da26ffe7
Pipeline #6561 passed with stages
in 622 minutes and 39 seconds
......@@ -34,6 +34,7 @@ module Hadrian.Utilities (
Dynamic, fromDynamic, toDyn, TypeRep, typeOf
) where
import Control.Applicative
import Control.Monad.Extra
import Data.Char
import Data.Dynamic (Dynamic, fromDynamic, toDyn)
......@@ -296,7 +297,9 @@ createFileLinkUntracked linkTarget link = do
let dir = takeDirectory link
liftIO $ IO.createDirectoryIfMissing True dir
putProgressInfo =<< renderCreateFileLink linkTarget link
quietly . liftIO $ IO.createFileLink linkTarget link
quietly . liftIO $ do
IO.removeFile link <|> return ()
IO.createFileLink linkTarget link
-- | Link a file tracking the link target. Create the target directory if
-- missing.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment