Skip to content

Commit

Permalink
fix persisting of variant selection if everything else is up-to-date
Browse files Browse the repository at this point in the history
  • Loading branch information
memo33 committed May 16, 2024
1 parent deb9306 commit e1a02fd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
The error handling for syntactically invalid YAML files is more graceful now, as well.
- The dates in the `lastModified` field are now more lenient in terms of surrounding whitespace.
- an issue in which incomplete variant definitions were not detected
- a rare bug in which the variant selection was not stored if all packages were up-to-date


## [0.4.2] - 2024-04-18
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/sc4pac/Sc4pac.scala
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,8 @@ trait UpdateService { this: Sc4pac =>
plan = UpdatePlan.fromResolution(resolution, installed = pluginsLockData.dependenciesWithAssets)
continue <- ZIO.serviceWithZIO[Prompter](_.confirmUpdatePlan(plan))
.filterOrFail(_ == true)(error.Sc4pacAbort())
flagOpt <- ZIO.unless(plan.isUpToDate || !continue)(for {
_ <- ZIO.unless(globalVariant == globalVariant0)(storeGlobalVariant(globalVariant)) // only store something after confirmation
_ <- ZIO.unless(!continue || globalVariant == globalVariant0)(storeGlobalVariant(globalVariant)) // only store something after confirmation
flagOpt <- ZIO.unless(!continue || plan.isUpToDate)(for {
assetsToInstall <- resolution.fetchArtifactsOf(resolution.transitiveDependencies.filter(plan.toInstall).reverse) // we start by fetching artifacts in reverse as those have fewest dependencies of their own
// TODO if some artifacts fail to be fetched, fall back to installing remaining packages (maybe not(?), as this leads to missing dependencies,
// but there needs to be a manual workaround in case of permanently missing artifacts)
Expand Down

0 comments on commit e1a02fd

Please sign in to comment.