@@ -28,7 +28,7 @@ import Bootstrap.Error
2828import Bootstrap.Monad (MonadBootstrap )
2929import Bootstrap.Terminal (promptYesNo , withAttribute , withAttributes )
3030import Control.Exception (IOException )
31- import Control.Monad.Catch (MonadCatch , catchAll , try )
31+ import Control.Monad.Catch (catchAll , try )
3232import Data.Char (toLower )
3333import Data.Tree (Tree (Node , rootLabel , subForest ))
3434import Language.Haskell.TH (Quote )
@@ -61,9 +61,9 @@ getOverwriteStatus :: MonadIO m => FilePath -> Text -> m OverwriteStatus
6161getOverwriteStatus path newContents = liftIO do
6262 doesFileExist path >>= \ case
6363 True ->
64- readFileText path `catchAll` const (pure " " ) >>= \ oldContents ->
64+ readFileBS path `catchAll` const (pure " " ) >>= \ oldContents ->
6565 pure $
66- if oldContents == newContents
66+ if oldContents == encodeUtf8 newContents
6767 then NoContentChange
6868 else WillOverwrite
6969 False -> pure NothingToOverwrite
@@ -190,7 +190,7 @@ bootstrap BuildPlan {..} =
190190 r2 <- bootstrapFile (second contents f)
191191 pure (r1, r2)
192192
193- createParentDir :: ( MonadCatch m , MonadIO m ) => FilePath -> ExceptT Text m ()
193+ createParentDir :: MonadIO m => FilePath -> ExceptT Text m ()
194194createParentDir path =
195195 let dir = takeDirectory path
196196 in ExceptT $
@@ -201,7 +201,7 @@ createParentDir path =
201201 )
202202 <$> liftIO (try $ createDirectoryIfMissing True dir)
203203
204- bootstrapFile :: ( MonadCatch m , MonadIO m ) => (FilePath , Text ) -> ExceptT Text m ()
204+ bootstrapFile :: MonadIO m => (FilePath , Text ) -> ExceptT Text m ()
205205bootstrapFile (path, contents) =
206206 ExceptT $
207207 first
0 commit comments