Skip to content

Commit 9fcacbd

Browse files
committed
Fix CPP defines for windows+brick
1 parent ba4c6e5 commit 9fcacbd

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

app/ghcup/BrickMain.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ import qualified Data.Text.Lazy as L
6161
import qualified Graphics.Vty as Vty
6262
import qualified Data.Vector as V
6363
import System.Environment (getExecutablePath)
64+
#if !IS_WINDOWS
6465
import qualified System.Posix.Process as SPP
66+
#endif
6567

6668

6769
hiddenTools :: [Tool]
@@ -500,12 +502,15 @@ install' _ (_, ListResult {..}) = do
500502
forM_ (_viPostInstall =<< vi) $ \msg -> logInfo msg
501503
case lTool of
502504
GHCup -> do
505+
#if !IS_WINDOWS
503506
up <- liftIO $ fmap (either (const Nothing) Just)
504507
$ try @_ @SomeException $ canonicalizePath (binDir </> "ghcup" <.> exeExt)
505508
when ((normalise <$> up) == Just (normalise ce)) $
506509
-- TODO: track cli arguments of previous invocation
507510
liftIO $ SPP.executeFile ce False ["tui"] Nothing
511+
#else
508512
logInfo "Please restart 'ghcup' for the changes to take effect"
513+
#endif
509514
_ -> pure ()
510515
pure $ Right ()
511516
VRight (vi, _, _) -> do

lib/GHCup/Types.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ data KeyBindings = KeyBindings
475475
deriving (Show, GHC.Generic)
476476

477477
instance NFData KeyBindings
478-
#if defined(IS_WINDOWS) || !defined(BRICK)
478+
#if !defined(BRICK)
479479
instance NFData Key
480480

481481
instance NFData Modifier

0 commit comments

Comments
 (0)