@@ -39,6 +39,7 @@ import qualified Data.ByteString.Lazy as BSL
3939import Data.Default (def)
4040import Data.Function ((&), on)
4141import Data.Map (Map)
42+import Data.Maybe (isJust)
4243import Data.Text (Text)
4344import qualified Data.Text as T
4445import Data.Text.Encoding (decodeUtf8, encodeUtf8)
@@ -410,12 +411,14 @@ watchStaticFilesDerivation root = do
410411 drv <- performEvent $ ffor checkForChanges $ \_ ->
411412 liftIO $ runObelisk ob showDerivation
412413 drvs <- foldDyn (\new (_, old, _) -> (old, new, old /= new)) (drv0, drv0, False) drv
413− out <- throttleBatchWithLag
414− (\e -> performEvent $ ffor e $ \_ ->
415− liftIO $ runObelisk ob $ buildStaticCatchErrors >> pure ())
416− (void $ fmapMaybe (^._2) $ ffilter (^._3) $ updated drvs)
417− performEvent_ $ ffor out $ \_ -> runObelisk ob $
418− putLog Notice "Static assets rebuilt and symlinked to static.out"
414+ void $ throttleBatchWithLag
415+ (\e -> performEvent $ ffor e $ \_ -> liftIO $ runObelisk ob $ do
416+ putLog Notice "Static assets being built..."
417+ buildStaticCatchErrors >>= \case
418+ Nothing -> pure ()
419+ Just _ -> putLog Notice "Static assets built and symlinked to static.out"
420+ )
421+ ((() <$) . ffilter (\x -> isJust (x ^._2) && x ^._3) $ updated drvs)
419422 pure never
420423 where
421424 handleBuildFailure
@@ -426,7 +429,8 @@ watchStaticFilesDerivation root = do
426429 ExitSuccess -> pure $ Just $ T.pack out
427430 _ -> do
428431 putLog Error $
429− "Static assets build failed: " <> T.pack err
432+ ("Static assets build failed: " <>) $
433+ T.unlines $ reverse $ take 10 $ reverse $ T.lines $ T.pack err
430434 pure Nothing
431435 showDerivation :: MonadObelisk m => m (Maybe Text)
432436 showDerivation =