@@ -146,7 +146,6 @@ makeConcreteResolver
146146 -> RIO env RawSnapshotLocation
147147makeConcreteResolver (ARResolver r) = pure r
148148makeConcreteResolver ar = do
149- snapshots <- getSnapshots
150149 r <-
151150 case ar of
152151 ARResolver r -> assert False $ makeConcreteResolver (ARResolver r)
@@ -157,16 +156,18 @@ makeConcreteResolver ar = do
157156 iopc <- loadConfigYaml (parseProjectAndConfigMonoid (parent fp)) fp
158157 ProjectAndConfigMonoid project _ <- liftIO iopc
159158 return $ projectResolver project
160- ARLatestNightly -> return $ nightlySnapshotLocation $ snapshotsNightly snapshots
161- ARLatestLTSMajor x ->
159+ ARLatestNightly -> nightlySnapshotLocation . snapshotsNightly <$> getSnapshots
160+ ARLatestLTSMajor x -> do
161+ snapshots <- getSnapshots
162162 case IntMap. lookup x $ snapshotsLts snapshots of
163163 Nothing -> throwString $ " No LTS release found with major version " ++ show x
164164 Just y -> return $ ltsSnapshotLocation x y
165- ARLatestLTS
166- | IntMap. null $ snapshotsLts snapshots -> throwString " No LTS releases found"
167- | otherwise ->
168- let (x, y) = IntMap. findMax $ snapshotsLts snapshots
169- in return $ ltsSnapshotLocation x y
165+ ARLatestLTS -> do
166+ snapshots <- getSnapshots
167+ if IntMap. null $ snapshotsLts snapshots
168+ then throwString " No LTS releases found"
169+ else let (x, y) = IntMap. findMax $ snapshotsLts snapshots
170+ in return $ ltsSnapshotLocation x y
170171 logInfo $ " Selected resolver: " <> display r
171172 return r
172173
0 commit comments