Update instructions on how to set callback

This commit is contained in:
2024-06-16 18:31:08 +02:00
parent 50da591a6a
commit 5a6d0684b7

View File

@ -70,8 +70,23 @@ await UpdateCheck(
selfUpdaterName: "MyApp Self-Updater.app",
selfUpdaterPath: "~/.config/com.example.my-app/updater",
caskUrl: URL(string: "https://my-app.test/latest/build.rb")!,
promptOnFailure: true
).perform()
).perform(promptOnFailure: true)
```
You can also specify what callback needs to be used to determine the correct URL for the release notes. You may need to get some information from the CaskFile, which you are free to source. For example:
```swift
import NVAppUpdater
await UpdateCheck(
selfUpdaterName: "MyApp Self-Updater.app",
selfUpdaterPath: "~/.config/com.example.my-app/updater",
caskUrl: URL(string: "https://my-app.test/latest/build.rb")!,
)
.resolvingReleaseNotes(with: { caskFile in
return URL(string: "https://my-app.com/release-notes/\(caskFile.version)")!
})
.perform(promptOnFailure: true)
```
## Self-Updater