Closed fredpi closed 5 years ago
Given that we have
git -C
calls elsewhere too (and it's always the same three calls), shouln't we refactor this to a method and do the try-catch for all cases? The method might be throwing so we can handle the error case on the usage side.
If I looked it up properly, the other git -C
calls happen after Swift PM resolves the dependencies. So if we delete the checked out repo, Swift PM won't come to the rescue and redownload it just afterwards. This is why I think, it's only suitable to apply this handling to the git -C
commands run before DependencyResolverService.shared.resolveDependencies()
is performed.
@fredpi As I've already stated:
The method might be throwing so we can handle the error case on the usage side.
What I mean there is that the refactored method should actually not include a do-catch
but instead a try
and be throwing. Then whenever we know what to do as an alternative when the reset fails, we could act accordingly (like deleting checkouts in the one case).
@Dschee Sorry, I didn't read carefully -.-
No problem, I may have been ambiguous or at least not so clear. 😅
Should be good to merge now
Please also remove the [WIP] in the title when it's ready for merge. :)
Looks good now, merging. Thanks for the PR! 🎉
Oh no, we forgot the Changelog entry. 😄
Fixes #27 using a pragmatic approach.
As Accio currently fails to build (maybe only on my machine?) due to a build error in xcodeproj, this is not tested yet.