@@ -5,9 +5,9 @@
55{-# LANGUAGE MultiWayIf #-}
66{-# LANGUAGE OverloadedStrings #-}
77{-# LANGUAGE PatternGuards #-}
8+{-# LANGUAGE QuasiQuotes #-}
89{-# LANGUAGE ScopedTypeVariables #-}
910{-# LANGUAGE TypeApplications #-}
10−{-# LANGUAGE QuasiQuotes #-}
1111module Obelisk.Command.Thunk where
1212
1313import Control.Applicative
@@ -368,7 +368,7 @@ overwriteThunk target thunk = do
368368 Right _ -> pure ()
369369
370370 --TODO: Is there a safer way to do this overwriting?
371− liftIO $ removeDirectoryRecursive target
371+ callProcessAndLogOutput (Debug, Error) $ proc rmPath ["-r", target] -- target may be a symlink
372372 createThunk target thunk
373373
374374thunkPtrToSpec :: ThunkPtr -> ThunkSpec
@@ -751,7 +751,7 @@ unpackThunk' noTrail thunkDir = checkThunkDirectory "Can't pack/unpack from with
751751 callProcessAndLogOutput (Notice, Error) $
752752 proc cp ["-r", "-T", thunkDir </> ".", obGitDir </> "orig-thunk"]
753753 callProcessAndLogOutput (Notice, Error) $
754− proc "rm" ["-r", thunkDir]
754+ proc rmPath ["-r", thunkDir]
755755 callProcessAndLogOutput (Notice, Error) $
756756 proc "mv" ["-T", tmpRepo, thunkDir]
757757
@@ -767,7 +767,7 @@ packThunk' noTrail (ThunkPackConfig force thunkConfig) thunkDir = checkThunkDire
767767 withSpinner' ("Packing thunk " <> T.pack thunkDir)
768768 (finalMsg noTrail $ const $ "Packed thunk " <> T.pack thunkDir) $ do
769769 thunkPtr <- modifyThunkPtrByConfig thunkConfig <$> getThunkPtr (not force) thunkDir (_thunkConfig_private thunkConfig)
770− liftIO $ removeDirectoryRecursive thunkDir
770+ callProcessAndLogOutput (Debug, Error) $ proc rmPath ["-r", thunkDir] -- thunkDir may be a symlink
771771 createThunk thunkDir thunkPtr
772772 pure thunkPtr
773773