Move platform faking option into install subcommand
This commit is contained in:
parent
f8448cf02b
commit
fee16758de
@ -63,7 +63,6 @@ data Options = Options
|
|||||||
, optCache :: Bool
|
, optCache :: Bool
|
||||||
, optUrlSource :: Maybe URI
|
, optUrlSource :: Maybe URI
|
||||||
, optNoVerify :: Bool
|
, optNoVerify :: Bool
|
||||||
, optPlatform :: Maybe PlatformRequest
|
|
||||||
-- commands
|
-- commands
|
||||||
, optCommand :: Command
|
, optCommand :: Command
|
||||||
}
|
}
|
||||||
@ -87,6 +86,7 @@ data InstallCommand = InstallGHC InstallOptions
|
|||||||
|
|
||||||
data InstallOptions = InstallOptions
|
data InstallOptions = InstallOptions
|
||||||
{ instVer :: Maybe ToolVersion
|
{ instVer :: Maybe ToolVersion
|
||||||
|
, instPlatform :: Maybe PlatformRequest
|
||||||
}
|
}
|
||||||
|
|
||||||
data SetGHCOptions = SetGHCOptions
|
data SetGHCOptions = SetGHCOptions
|
||||||
@ -146,18 +146,6 @@ opts =
|
|||||||
(short 'n' <> long "no-verify" <> help
|
(short 'n' <> long "no-verify" <> help
|
||||||
"Skip tarball checksum verification (default: False)"
|
"Skip tarball checksum verification (default: False)"
|
||||||
)
|
)
|
||||||
<*> (optional
|
|
||||||
(option
|
|
||||||
(eitherReader platformParser)
|
|
||||||
( short 'p'
|
|
||||||
<> long "platform"
|
|
||||||
<> metavar "PLATFORM"
|
|
||||||
<> help
|
|
||||||
"Override for platform (triple matching ghc tarball names), e.g. x86_64-fedora27-linux"
|
|
||||||
<> internal
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
<*> com
|
<*> com
|
||||||
where
|
where
|
||||||
parseUri s' =
|
parseUri s' =
|
||||||
@ -248,7 +236,21 @@ installP = subparser
|
|||||||
)
|
)
|
||||||
|
|
||||||
installOpts :: Parser InstallOptions
|
installOpts :: Parser InstallOptions
|
||||||
installOpts = InstallOptions <$> optional toolVersionParser
|
installOpts =
|
||||||
|
InstallOptions
|
||||||
|
<$> optional toolVersionParser
|
||||||
|
<*> (optional
|
||||||
|
(option
|
||||||
|
(eitherReader platformParser)
|
||||||
|
( short 'p'
|
||||||
|
<> long "platform"
|
||||||
|
<> metavar "PLATFORM"
|
||||||
|
<> help
|
||||||
|
"Override for platform (triple matching ghc tarball names), e.g. x86_64-fedora27-linux"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
setGHCOpts :: Parser SetGHCOptions
|
setGHCOpts :: Parser SetGHCOptions
|
||||||
setGHCOpts = SetGHCOptions <$> optional toolVersionParser
|
setGHCOpts = SetGHCOptions <$> optional toolVersionParser
|
||||||
@ -612,7 +614,7 @@ main = do
|
|||||||
void
|
void
|
||||||
$ (runInstTool $ do
|
$ (runInstTool $ do
|
||||||
v <- liftE $ fromVersion dls instVer GHC
|
v <- liftE $ fromVersion dls instVer GHC
|
||||||
liftE $ installGHCBin dls v optPlatform
|
liftE $ installGHCBin dls v instPlatform
|
||||||
)
|
)
|
||||||
>>= \case
|
>>= \case
|
||||||
VRight _ -> runLogger
|
VRight _ -> runLogger
|
||||||
@ -635,7 +637,7 @@ Check the logs at ~/.ghcup/logs and the build directory #{tmpdir} for more clues
|
|||||||
void
|
void
|
||||||
$ (runInstTool $ do
|
$ (runInstTool $ do
|
||||||
v <- liftE $ fromVersion dls instVer Cabal
|
v <- liftE $ fromVersion dls instVer Cabal
|
||||||
liftE $ installCabalBin dls v optPlatform
|
liftE $ installCabalBin dls v instPlatform
|
||||||
)
|
)
|
||||||
>>= \case
|
>>= \case
|
||||||
VRight _ -> runLogger
|
VRight _ -> runLogger
|
||||||
|
Loading…
Reference in New Issue
Block a user