Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
ghcup-hs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Adrien
ghcup-hs
Commits
5d94d0bf
Verified
Commit
5d94d0bf
authored
4 years ago
by
Julian Ospald
Browse files
Options
Downloads
Patches
Plain Diff
Also check for GHC and Cabal updates on start
parent
72bcfa92
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/ghcup/Main.hs
+22
-1
22 additions, 1 deletion
app/ghcup/Main.hs
ghcup.cabal
+1
-0
1 addition, 0 deletions
ghcup.cabal
with
23 additions
and
1 deletion
app/ghcup/Main.hs
+
22
−
1
View file @
5d94d0bf
...
...
@@ -46,6 +46,7 @@ import Language.Haskell.TH
import
Options.Applicative
hiding
(
style
)
import
Options.Applicative.Help.Pretty
(
text
)
import
Prelude
hiding
(
appendFile
)
import
Safe
import
System.Console.Pretty
import
System.Environment
import
System.Exit
...
...
@@ -1030,7 +1031,9 @@ printListResult lr = do
putStrLn
$
formatted
checkForUpdates
::
(
MonadFail
m
,
MonadLogger
m
)
=>
GHCupDownloads
->
m
()
checkForUpdates
::
(
MonadIO
m
,
MonadFail
m
,
MonadLogger
m
)
=>
GHCupDownloads
->
m
()
checkForUpdates
dls
=
do
forM_
(
getLatest
dls
GHCup
)
$
\
l
->
do
(
Right
ghc_ver
)
<-
pure
$
version
$
prettyPVP
ghcUpVer
...
...
@@ -1038,6 +1041,24 @@ checkForUpdates dls = do
$
$
(
logWarn
)
[
i
|
New GHCup version available: #{prettyVer l}. To upgrade, run 'ghcup upgrade'
|]
forM_
(
getLatest
dls
GHC
)
$
\
l
->
do
mghc_ver
<-
latestInstalled
GHC
forM
mghc_ver
$
\
ghc_ver
->
when
(
l
>
ghc_ver
)
$
$
(
logWarn
)
[
i
|
New GHC version available: #{prettyVer l}. To upgrade, run 'ghcup install #{prettyVer l}'
|]
forM_
(
getLatest
dls
Cabal
)
$
\
l
->
do
mcabal_ver
<-
latestInstalled
Cabal
forM
mcabal_ver
$
\
cabal_ver
->
when
(
l
>
cabal_ver
)
$
$
(
logWarn
)
[
i
|
New Cabal version available: #{prettyVer l}. To upgrade, run 'ghcup install-cabal #{prettyVer l}'
|]
where
latestInstalled
tool
=
(
fmap
lVer
.
lastMay
)
<$>
liftIO
(
listVersions
dls
(
Just
tool
)
(
Just
ListInstalled
))
prettyDebugInfo
::
DebugInfo
->
String
prettyDebugInfo
DebugInfo
{
..
}
=
[
i
|
Debug Info
...
...
This diff is collapsed.
Click to expand it.
ghcup.cabal
+
1
−
0
View file @
5d94d0bf
...
...
@@ -326,6 +326,7 @@ executable ghcup
, optparse-applicative
, pretty-terminal
, resourcet
, safe
, string-interpolate
, table-layout
, template-haskell
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment