diff --git a/Scripts/Swift/SetUpCICDService.swift b/Scripts/Swift/SetUpCICDService.swift index f8b06c77..35a22abb 100644 --- a/Scripts/Swift/SetUpCICDService.swift +++ b/Scripts/Swift/SetUpCICDService.swift @@ -5,9 +5,9 @@ import Foundation let fileManager = FileManager.default enum CICDService { - case github, bitrise, codemagic, later, none + case github, bitrise, codemagic, later - init(_ name: String) { + init?(_ name: String) { switch name.lowercased() { case "g", "github": self = .github @@ -17,14 +17,15 @@ enum CICDService { self = .codemagic case "l", "later": self = .later - default: self = .none + default: + return nil } } } -var service = CICDService.none +var service: CICDService? = nil -while service == .none { +while service == nil { print("Which CI/CD service do you use (Can be edited later) [(g)ithub/(b)itrise/(c)odemagic/(l)ater]: ") service = CICDService(readLine() ?? "") } @@ -42,7 +43,7 @@ case .codemagic: print("Setting template for CodeMagic") fileManager.removeItems(in: "bitrise.yml") fileManager.removeItems(in: ".github/workflows") -case .later, .none: +case .later: print("You can manually setup the template later.") } diff --git a/Scripts/Swift/SetUpDeliveryConstants.swift b/Scripts/Swift/SetUpDeliveryConstants.swift index 97a4813f..dfaf1f43 100644 --- a/Scripts/Swift/SetUpDeliveryConstants.swift +++ b/Scripts/Swift/SetUpDeliveryConstants.swift @@ -6,9 +6,7 @@ let fileManager = FileManager.default print("Do you want to set up Constants values? (Can be edited later) [Y/n]: ") -var arg = "y" - -arg = readLine() ?? arg +var arg = readLine() ?? "y" switch arg.lowercased() { case "y", "yes", "":