mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-24 04:38:16 +00:00
Improve displaying release notes in sparkle-cli (safer & less code)
This commit is contained in:
1 parent
a51edf3dad
commit
1a0e169e7f
1 file changed
+10
-4
@@ -120,18 +120,24 @@
|
||||
});
|
||||
}
|
||||
|
||||
- (void)displayReleaseNotes:(const char * _Nullable)releaseNotes
|
||||
{
|
||||
if (releaseNotes != NULL) {
|
||||
fprintf(stderr, "Release notes:\n");
|
||||
fprintf(stderr, "%s\n", releaseNotes);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)displayHTMLReleaseNotes:(NSData *)releaseNotes
|
||||
{
|
||||
NSAttributedString *attributedString = [[NSAttributedString alloc] initWithHTML:releaseNotes documentAttributes:NULL];
|
||||
fprintf(stderr, "Release notes:\n");
|
||||
fprintf(stderr, "%s\n", attributedString.string.UTF8String);
|
||||
[self displayReleaseNotes:attributedString.string.UTF8String];
|
||||
}
|
||||
|
||||
- (void)displayPlainTextReleaseNotes:(NSData *)releaseNotes encoding:(NSStringEncoding)encoding
|
||||
{
|
||||
NSString *string = [[NSString alloc] initWithData:releaseNotes encoding:encoding];
|
||||
fprintf(stderr, "Release notes:\n");
|
||||
fprintf(stderr, "%s\n", string.UTF8String);
|
||||
[self displayReleaseNotes:string.UTF8String];
|
||||
}
|
||||
|
||||
- (void)showUpdateWithAppcastItem:(SUAppcastItem *)appcastItem updateAdjective:(NSString *)updateAdjective
|
||||
|
||||
Reference in new issue
Block a user