Skip to content

Commit

Permalink
Bump to 0.1.16.1
Browse files Browse the repository at this point in the history
  • Loading branch information
hasufell committed Jul 28, 2021
1 parent 810607e commit b38a569
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Revision history for ghcup

## 0.1.16 -- 2021-07-28
## 0.1.16.1 -- 2021-07-29

* Add 'nuke' subcommand wrt [#135](https://gitlab.haskell.org/haskell/ghcup-hs/-/issues/135), implemented by Arjun Kathuria
* Add uninstallation powershell script on windows wrt [#150](https://gitlab.haskell.org/haskell/ghcup-hs/-/issues/150)
Expand Down
2 changes: 1 addition & 1 deletion ghcup.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 3.0
name: ghcup
version: 0.1.16
version: 0.1.16.1
license: LGPL-3.0-only
license-file: LICENSE
copyright: Julian Ospald 2020
Expand Down
29 changes: 15 additions & 14 deletions lib/GHCup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1019,8 +1019,8 @@ listVersions lt' criteria = do
slr <- strayStacks avTools sSet stacks
pure (sort (slr ++ lr))
GHCup -> do
let cg = currentGHCup avTools
pure (sort (cg : lr))
let cg = maybeToList $ currentGHCup avTools
pure (sort (cg ++ lr))
Nothing -> do
ghcvers <- go (Just GHC) cSet cabals hlsSet' hlses sSet stacks
cabalvers <- go (Just Cabal) cSet cabals hlsSet' hlses sSet stacks
Expand Down Expand Up @@ -1180,24 +1180,25 @@ listVersions lt' criteria = do
[i|Could not parse version of stray directory #{e}|]
pure Nothing

currentGHCup :: Map.Map Version VersionInfo -> ListResult
currentGHCup :: Map.Map Version VersionInfo -> Maybe ListResult
currentGHCup av =
let currentVer = pvpToVersion ghcUpVer
listVer = Map.lookup currentVer av
latestVer = fst <$> headOf (getTagged Latest) av
recommendedVer = fst <$> headOf (getTagged Latest) av
isOld = maybe True (> currentVer) latestVer && maybe True (> currentVer) recommendedVer
in ListResult { lVer = currentVer
, lTag = maybe (if isOld then [Old] else []) _viTags listVer
, lCross = Nothing
, lTool = GHCup
, fromSrc = False
, lStray = isNothing listVer
, lSet = True
, lInstalled = True
, lNoBindist = False
, hlsPowered = False
}
in if | currentVer == listVer -> Nothing
| otherwise -> ListResult { lVer = currentVer
, lTag = maybe (if isOld then [Old] else []) _viTags listVer
, lCross = Nothing
, lTool = GHCup
, fromSrc = False
, lStray = isNothing listVer
, lSet = True
, lInstalled = True
, lNoBindist = False
, hlsPowered = False
}

-- NOTE: this are not cross ones, because no bindists
toListResult :: ( MonadLogger m
Expand Down

0 comments on commit b38a569

Please sign in to comment.