mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-24 04:38:16 +00:00
Add showing release notes from sparkle-cli
This commit is contained in:
1 parent
1446acf519
commit
fbb9fbf535
1 file changed
+26
-2
@@ -119,22 +119,46 @@
|
||||
});
|
||||
}
|
||||
|
||||
- (void)displayReleaseNotes:(NSData *)releaseNotes
|
||||
{
|
||||
NSAttributedString *attributedString = [[NSAttributedString alloc] initWithHTML:releaseNotes documentAttributes:NULL];
|
||||
fprintf(stderr, "Release notes:\n");
|
||||
fprintf(stderr, "%s\n", attributedString.string.UTF8String);
|
||||
}
|
||||
|
||||
- (void)showUpdateFoundWithAppcastItem:(SUAppcastItem *)appcastItem allowsAutomaticUpdates:(BOOL)__unused allowsAutomaticUpdates alreadyDownloaded:(BOOL)__unused alreadyDownloaded reply:(void (^)(SUUpdateAlertChoice))reply
|
||||
{
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if (self.verbose) {
|
||||
fprintf(stderr, "Found new update! (%s)\n", appcastItem.displayVersionString.UTF8String);
|
||||
|
||||
if (appcastItem.itemDescription != nil) {
|
||||
NSData *descriptionData = [appcastItem.itemDescription dataUsingEncoding:NSUTF8StringEncoding];
|
||||
if (descriptionData != nil) {
|
||||
[self displayReleaseNotes:descriptionData];
|
||||
}
|
||||
}
|
||||
}
|
||||
reply(SUInstallUpdateChoice);
|
||||
});
|
||||
}
|
||||
|
||||
- (void)showUpdateReleaseNotes:(NSData *)__unused releaseNotes
|
||||
- (void)showUpdateReleaseNotes:(NSData *)releaseNotes
|
||||
{
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if (self.verbose) {
|
||||
[self displayReleaseNotes:releaseNotes];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
- (void)showUpdateReleaseNotesFailedToDownloadWithError:(NSError *)__unused error
|
||||
- (void)showUpdateReleaseNotesFailedToDownloadWithError:(NSError *)error
|
||||
{
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if (self.verbose) {
|
||||
fprintf(stderr, "Error: Unable to download release notes: %s\n", error.description.UTF8String);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
- (void)showUpdateNotFoundWithAcknowledgement:(void (^)(void))__unused acknowledgement
|
||||
|
||||
Reference in new issue
Block a user