-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: update need newer file #37
feat: update need newer file #37
Conversation
clear the logic
src/commonMain/kotlin/teksturepako/pakku/api/actions/update/Update.kt
Outdated
Show resolved
Hide resolved
src/commonMain/kotlin/teksturepako/pakku/api/actions/update/Update.kt
Outdated
Show resolved
Hide resolved
src/commonMain/kotlin/teksturepako/pakku/api/projects/ProjectFile.kt
Outdated
Show resolved
Hide resolved
acc -= accProject | ||
acc += combinedProject | ||
} | ||
val accFiles = projectsToFiles[accProject]!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be nullable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fold is iterating the keys of the map. And the lines below ensured the key exists. It's a bug if it's null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but it shouldn't throw NPE when there is a bug. Maybe the function should return a Result<MutableSet<Project>, ActionError>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How to describe the error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UpdateFailed(val project: Project, val reason: String) : ActionError("Failed to update ${project.type} ${project.slug}; $reason")
For the message use ${project.getFullMsg()}
Also, the reason should tell what happened wrong.
src/commonMain/kotlin/teksturepako/pakku/api/actions/update/Update.kt
Outdated
Show resolved
Hide resolved
src/commonMain/kotlin/teksturepako/pakku/api/projects/ProjectFile.kt
Outdated
Show resolved
Hide resolved
src/commonMain/kotlin/teksturepako/pakku/api/projects/ProjectFile.kt
Outdated
Show resolved
Hide resolved
src/commonMain/kotlin/teksturepako/pakku/api/projects/ProjectFile.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a bunch!
When targeting multi loader mods. Some mod has older version that mark as supporting prefer loader sorted by #36 will become the first.
This PR make the update require the files on particular platform newer than the local by recording the publishing date for project files.