mirror of
https://github.com/cirruslabs/tart.git
synced 2026-10-18 03:53:56 +02:00
Collect installation information (#390)
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import ArgumentParser
|
||||
import Foundation
|
||||
import Sentry
|
||||
|
||||
struct ReportInstallation: AsyncParsableCommand {
|
||||
static var configuration = CommandConfiguration(
|
||||
commandName: "report-installation",
|
||||
abstract: "Send installation event to Sentry if configured",
|
||||
discussion: """
|
||||
Reports macOS version and device model for analytics purposes.
|
||||
Helps Cirrus Labs team to prioritize testing on most popular devices.
|
||||
""",
|
||||
shouldDisplay: false
|
||||
)
|
||||
|
||||
func run() async throws {
|
||||
let installationEvent = Event()
|
||||
installationEvent.message = SentryMessage(formatted: "installed")
|
||||
installationEvent.level = SentryLevel.info
|
||||
installationEvent.user = nil
|
||||
installationEvent.stacktrace = nil
|
||||
let id = SentrySDK.capture(event: installationEvent)
|
||||
print("Captured installation event #\(id)!")
|
||||
}
|
||||
}
|
||||
@@ -33,6 +33,7 @@ struct Root: AsyncParsableCommand {
|
||||
Rename.self,
|
||||
Stop.self,
|
||||
Delete.self,
|
||||
ReportInstallation.self,
|
||||
])
|
||||
|
||||
public static func main() async throws {
|
||||
|
||||
Reference in New Issue
Block a user