1module Stackage.CheckPlan
5import Control.Monad (unless)
7import Stackage.InstallInfo
9import System.Exit (ExitCode (ExitFailure), exitWith)
10import System.Process (readProcess)
12data Mismatch = OnlyDryRun String | OnlySimpleList String
15checkPlan :: InstallInfo -> IO ()
17 dryRun' <- readProcess "cabal-dev" ("install":"--dry-run":"-fnetwork23":iiPackageList ii) ""
18 let dryRun = sort $ drop 2 $ lines dryRun'
19 let mismatches = getMismatches dryRun (iiPackageList ii)
20 unless (null mismatches) $ do
21 putStrLn "Found the following mismtaches"
22 mapM_ print mismatches
23 exitWith $ ExitFailure 1
25getMismatches :: [String] -> [String] -> [Mismatch]
29 go [] y = map OnlySimpleList y
30 go x [] = map OnlyDryRun x
34 LT -> OnlyDryRun x : go xs (y:ys)
35 GT -> OnlySimpleList y : go (x:xs) ys
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list