mirror of
				https://github.com/maxgoedjen/secretive.git
				synced 2025-10-31 15:30:57 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			34 lines
		
	
	
		
			825 B
		
	
	
	
		
			Swift
		
	
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
		
			825 B
		
	
	
	
		
			Swift
		
	
	
	
	
	
| import Foundation
 | |
| import Observation
 | |
| import Brief
 | |
| 
 | |
| @Observable @MainActor final class PreviewUpdater: UpdaterProtocol {
 | |
| 
 | |
|     var update: Release? = nil
 | |
| 
 | |
|     let currentVersion = SemVer("0.0.0_preview")
 | |
| 
 | |
|     init(update: Update = .none) {
 | |
|         switch update {
 | |
|         case .none:
 | |
|             self.update = nil
 | |
|         case .advisory:
 | |
|             self.update = Release(name: "10.10.10", prerelease: false, html_url: URL(string: "https://example.com")!, body: "Some regular update")
 | |
|         case .critical:
 | |
|             self.update = Release(name: "10.10.10", prerelease: false, html_url: URL(string: "https://example.com")!, body: "Critical Security Update")
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     func ignore(release: Release) async {
 | |
|     }
 | |
|     
 | |
| }
 | |
| 
 | |
| extension PreviewUpdater {
 | |
| 
 | |
|     enum Update {
 | |
|         case none, advisory, critical
 | |
|     }
 | |
| 
 | |
| }
 |