@@ -379,10 +379,12 @@ createThunkWithLatest target s = do
379379 }
380380
381381updateThunkToLatest :: MonadObelisk m => FilePath -> m ()
382−updateThunkToLatest target = withSpinner' ("Updating thunk " <> T.pack target <> " to latest") (pure $ const $ "Thunk " <> T.pack target <> " updated to latest") $
383− case target of
384− "." -> failWith "ob thunk update directory cannot be '.'"
385− _ -> do
382+updateThunkToLatest target = withSpinner' ("Updating thunk " <> T.pack target <> " to latest") (pure $ const $ "Thunk " <> T.pack target <> " updated to latest") $ do
383+ canonicalCurrentPath <- liftIO $ canonicalizePath "."
384+ canonicalTarget <- liftIO $ canonicalizePath target
385+ if canonicalCurrentPath == canonicalTarget
386+ then failWith "ob thunk update directory cannot be '.'"
387+ else do
386388 (overwrite, ptr) <- readThunk target >>= \case
387389 Left err -> failWith $ T.pack $ "thunk update: " <> show err
388390 Right c -> case c of