Fix CPP defines for windows+brick

This commit is contained in:
Julian Ospald 2023-11-05 18:00:23 +08:00
parent ba4c6e5b99
commit 9fcacbd96b
No known key found for this signature in database
GPG Key ID: 4275CDA6A29BED43
2 changed files with 6 additions and 1 deletions

View File

@ -61,7 +61,9 @@ import qualified Data.Text.Lazy as L
import qualified Graphics.Vty as Vty
import qualified Data.Vector as V
import System.Environment (getExecutablePath)
#if !IS_WINDOWS
import qualified System.Posix.Process as SPP
#endif
hiddenTools :: [Tool]
@ -500,12 +502,15 @@ install' _ (_, ListResult {..}) = do
forM_ (_viPostInstall =<< vi) $ \msg -> logInfo msg
case lTool of
GHCup -> do
#if !IS_WINDOWS
up <- liftIO $ fmap (either (const Nothing) Just)
$ try @_ @SomeException $ canonicalizePath (binDir </> "ghcup" <.> exeExt)
when ((normalise <$> up) == Just (normalise ce)) $
-- TODO: track cli arguments of previous invocation
liftIO $ SPP.executeFile ce False ["tui"] Nothing
#else
logInfo "Please restart 'ghcup' for the changes to take effect"
#endif
_ -> pure ()
pure $ Right ()
VRight (vi, _, _) -> do

View File

@ -475,7 +475,7 @@ data KeyBindings = KeyBindings
deriving (Show, GHC.Generic)
instance NFData KeyBindings
#if defined(IS_WINDOWS) || !defined(BRICK)
#if !defined(BRICK)
instance NFData Key
instance NFData Modifier