Ver código fonte

config(apple): create generic platform if it does not exist

osy 9 meses atrás
pai
commit
662dfb9cf0
1 arquivos alterados com 4 adições e 0 exclusões
  1. 4 0
      Configuration/UTMAppleConfigurationSystem.swift

+ 4 - 0
Configuration/UTMAppleConfigurationSystem.swift

@@ -67,6 +67,10 @@ struct UTMAppleConfigurationSystem: Codable {
         boot = try values.decode(UTMAppleConfigurationBoot.self, forKey: .boot)
         boot = try values.decode(UTMAppleConfigurationBoot.self, forKey: .boot)
         macPlatform = try values.decodeIfPresent(UTMAppleConfigurationMacPlatform.self, forKey: .macPlatform)
         macPlatform = try values.decodeIfPresent(UTMAppleConfigurationMacPlatform.self, forKey: .macPlatform)
         genericPlatform = try values.decodeIfPresent(UTMAppleConfigurationGenericPlatform.self, forKey: .genericPlatform)
         genericPlatform = try values.decodeIfPresent(UTMAppleConfigurationGenericPlatform.self, forKey: .genericPlatform)
+        if boot.operatingSystem == .linux && genericPlatform == nil {
+            // fix a bug where this was not created
+            genericPlatform = UTMAppleConfigurationGenericPlatform()
+        }
     }
     }
     
     
     func encode(to encoder: Encoder) throws {
     func encode(to encoder: Encoder) throws {