@@ -106,18 +106,18 @@ downloadFullModpack ModpackInstallOptions {..} = do
106
106
es <- mkEntrySelector " manifest.json"
107
107
getEntry es >>= decodeJSON . toLazy
108
108
let modpackVersion = C. formatWith [C. bold] $ manifest ^. # version
109
- mcVersion :: Text = C. formatWith [C. bold] $ show $ manifest ^. # minecraft . # version
109
+ mcVersion = C. formatWith [C. bold] $ display $ manifest ^. # minecraft . # version
110
110
logInfo [i |modpack version: $modpackVersion, MC version: $mcVersion|]
111
111
forOf_
112
112
do # minecraft . # modLoaders . each . filtered (^. # primary)
113
113
manifest
114
- \ ModLoaderInfo {id } -> logInfo $ [i |mod loader: ${}|] $ C. formatWith [C. bold] id
114
+ \ ModLoaderInfo {id } -> logInfo [i |mod loader: ${C.formatWith [C.bold] id}|]
115
115
116
116
let (optionalFileIds, requiredFileIds) =
117
117
manifest ^. # files & partitionWith \ f ->
118
118
(chosen %~ (^. # fileID)) . bool Left Right (f ^. # required) $ f
119
119
120
- logInfo $ [i |fetching metadata of $show mods|] $ length requiredFileIds
120
+ logInfo [i |fetching metadata of ${length requiredFileIds} mods|]
121
121
files <- getAddonFilesByFileIds requiredFileIds <&> (^.. each . folded)
122
122
123
123
let modDir = outDir </> [reldir |mods|]
@@ -128,24 +128,24 @@ downloadFullModpack ModpackInstallOptions {..} = do
128
128
(unzip -> (_, knownOldMods), trulyNewMods, sameMods) =
129
129
partitionThese . M. elems $ M. fromList oldModsByFP `align` M. fromList newModsByFP
130
130
deletableOldFiles = unknownMods <> knownOldMods
131
- for_ sameMods \ ((oldFile, toFilePath -> p), newFile) ->
131
+ for_ sameMods \ ((oldFile, p), newFile) ->
132
132
when (oldFile ^. # id /= newFile ^. # id ) $ throwString [i |internal ID conflict for mod $p|]
133
133
134
- whenNotNull sameMods $ logInfo . [i |$show mods already present|] . length
134
+ whenNotNull sameMods $ logInfo . [i |${} mods already present|] . length
135
135
136
136
case trulyNewMods of
137
137
[] -> logInfo " no new mods need to be downloaded"
138
138
_ -> do
139
139
let modSize = showBytes' $ sumOf (each . # fileLength) trulyNewMods
140
140
modCount = length trulyNewMods
141
- logInfo [i |downloading ${show modCount} mods ($modSize)|]
141
+ logInfo [i |downloading $modCount mods ($modSize)|]
142
142
stepWise (withGenericProgress modCount) \ step ->
143
143
forConcurrentlyNetwork_ trulyNewMods \ a -> step $ downloadAddonFile a modDir HideProgress
144
144
145
145
whenNotNull deletableOldFiles \ _ -> do
146
- logInfo $ [i |deleting $show stale mod files|] ( length deletableOldFiles)
146
+ logInfo [i |deleting ${length deletableOldFiles} stale mod files|]
147
147
for_ deletableOldFiles \ p -> do
148
- logTrace $ [i | - ${}|] $ toFilePath p
148
+ logTrace [i | - $p|]
149
149
removeFile p
150
150
151
151
whenNotNull optionalFileIds \ _ -> do
@@ -238,7 +238,7 @@ searchInstallModpack ModpackSearchInstallOptions {..} = do
238
238
Just <$> selectViaTable addons [" name" , " authors" , " download count" ] \ a ->
239
239
[ formattedVia C. green . toString $ a ^. # name,
240
240
TL. plain . intercalate " , " $ a ^.. # authors . each . # name . unpacked,
241
- TL. plain . show @ _ @ Int . round $ a ^. # downloadCount
241
+ TL. plain . toString . display @ Int . round $ a ^. # downloadCount
242
242
]
243
243
whenJust addon \ addon -> do
244
244
files <-
@@ -310,8 +310,8 @@ findInCurseDB inputs = do
310
310
Just FingerprintMatch {.. } -> Right (id , file, path)
311
311
Nothing -> Left path
312
312
unless (null unknown) do
313
- logWarn $ [i |these ${show } files are not present in the CurseForge mod database:|] $ length unknown
314
- for_ unknown $ logWarn . [i | - ${}|] . toFilePath
313
+ logWarn [i |these ${length unknown } files are not present in the CurseForge mod database:|]
314
+ for_ unknown $ logWarn . [i | - ${}|]
315
315
pure result
316
316
317
317
data ModLoader = ForgeModLoader | FabricModLoader
@@ -336,7 +336,7 @@ updateMods ModUpdateOptions {..} = do
336
336
outDir <- outDir & _Just %%~ makeSomeAbsolute
337
337
(_, updatable) <- findInCurseDB inputs
338
338
unless (null updatable) do
339
- logInfo $ [i |fetching update info for $show mods|] $ length updatable
339
+ logInfo [i |fetching update info for ${length updatable} mods|]
340
340
let isNewerFile file f =
341
341
f ^. # fileDate > file ^. # fileDate
342
342
&& case mcVersion of
@@ -361,7 +361,7 @@ updateMods ModUpdateOptions {..} = do
361
361
let addonName c a = C. formatWith c $ a ^. # name
362
362
fileName c f = C. formatWith c $ f ^. # displayName
363
363
case newerFiles of
364
- Nothing -> logInfo $ [i |no updates for ${}|] $ addonName [C. bold] addon
364
+ Nothing -> logInfo [i |no updates for ${addonName [C.bold] addon}|]
365
365
Just newerFiles -> do
366
366
let an = addonName [C. bold, C. green] addon
367
367
fn = fileName [C. bold] file
@@ -379,7 +379,7 @@ updateMods ModUpdateOptions {..} = do
379
379
if newFile ^. # id == file ^. # id
380
380
then logInfo " staying on current version"
381
381
else do
382
- logInfo $ [i |updating to ${}|] $ fileName [C. green, C. bold] newFile
382
+ logInfo [i |updating to ${fileName [C.green, C.bold] newFile}|]
383
383
downloadAddonFile newFile (outDir ?: parent path) ShowProgress
384
384
unless keepOld $ removeFile path
385
385
where
@@ -406,7 +406,7 @@ installMods ModsInstallOptions {..} = do
406
406
whenNotNull
407
407
do toList $ S. fromList fileIds S. \\ S. fromList (addonFiles ^.. each . to head . # id )
408
408
\ (coerce @ _ @ [Int ] . toList -> unknownFileIds) ->
409
- throwString $ [i |unknown file IDs: ${}|] $ T. intercalate " , " $ show <$> unknownFileIds
409
+ throwString $ [i |unknown file IDs: ${}|] $ T. intercalate " , " $ display <$> unknownFileIds
410
410
addons <- getAddons (addonFiles ^.. ifolded . asIndex) <&> M. fromList . fmapToFst (^. # id )
411
411
ensureDir outDir
412
412
addonFiles <- forM (itoList addonFiles) \ (aid, file :| _) -> do
@@ -422,7 +422,7 @@ installMods ModsInstallOptions {..} = do
422
422
[ formattedVia (C. bold <> C. green) . toString $ addon ^. # name,
423
423
formattedVia C. bold . toString $ file ^. # displayName
424
424
]
425
- logInfo $ [i |downloading $show mods|] $ length addonFiles
425
+ logInfo [i |downloading ${length addonFiles} mods|]
426
426
forConcurrentlyNetwork_ (addonFiles `zip` tableLines) \ ((_, file), line) -> do
427
427
logInfo $ toText line
428
428
downloadAddonFile file outDir HideProgress
@@ -469,10 +469,10 @@ searchInstallMod ModSearchInstallOptions {..} = do
469
469
Just <$> selectViaTable addons [" name" , " authors" , " download count" ] \ a ->
470
470
[ formattedVia C. green . toString $ a ^. # name,
471
471
TL. plain . intercalate " , " $ a ^.. # authors . each . # name . unpacked,
472
- TL. plain . show @ _ @ Int . round $ a ^. # downloadCount
472
+ TL. plain . toString . display @ Int . round $ a ^. # downloadCount
473
473
]
474
474
whenJust addon \ a@ Addon {name = addonName} -> do
475
- logInfo $ [i |selected ${}|] $ C. formatWith [C. green, C. bold] addonName
475
+ logInfo [i |selected ${C.formatWith [C.green, C.bold] addonName}|]
476
476
whenJustM (selectAddonFile a) \ file -> do
477
477
ensureDir outDir
478
478
downloadAddonFile file outDir ShowProgress
@@ -481,7 +481,7 @@ searchInstallMod ModSearchInstallOptions {..} = do
481
481
logInfo [i |fetching dependency metadata|]
482
482
deps <- findDeps requiredDependencyType file
483
483
whenNotNull deps \ deps -> do
484
- logInfo $ [i |downloading ${} dependencies|] $ C. formatWith [C. green, C. bold] addonName
484
+ logInfo [i |downloading ${C.formatWith [C.green, C.bold] addonName} dependencies|]
485
485
stepWise (withGenericProgress (length deps)) \ step ->
486
486
forConcurrentlyNetwork_ deps \ file ->
487
487
step $ downloadAddonFile file outDir HideProgress
@@ -503,7 +503,7 @@ searchInstallMod ModSearchInstallOptions {..} = do
503
503
TL. plain . toString . showBytes' $ f ^. # fileLength
504
504
]
505
505
whenJust file \ AddonFile {displayName = modFileName} ->
506
- logInfo $ [i |selected ${}|] $ C. formatWith [C. green, C. bold] modFileName
506
+ logInfo [i |selected ${C.formatWith [C.green, C.bold] modFileName}|]
507
507
pure file
508
508
509
509
findDeps dt =
@@ -545,8 +545,8 @@ deduplicateMods ModDeduplicateOptions {..} = do
545
545
& \ case
546
546
[] -> logInfo [i |no duplicated mods found|]
547
547
toBeRemoved -> do
548
- logInfo $ [i |removing $show old mods:|] $ length toBeRemoved
549
- for_ toBeRemoved $ logInfo . [i | - ${}|] . toFilePath
548
+ logInfo [i |removing ${length toBeRemoved} old mods:|]
549
+ for_ toBeRemoved $ logInfo . [i | - ${}|]
550
550
promptBool " remove" >>= \ case
551
551
True -> logInfo " removing old mods" *> for_ toBeRemoved removeFile
552
552
False -> logInfo " keeping old mods"
0 commit comments