Skip to content

Commit

Permalink
[#490] Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
blyscuit committed Jul 18, 2023
1 parent f7c7dd2 commit d98959b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
13 changes: 7 additions & 6 deletions Scripts/Swift/SetUpCICDService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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() ?? "")
}
Expand All @@ -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.")
}

Expand Down
4 changes: 1 addition & 3 deletions Scripts/Swift/SetUpDeliveryConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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", "":
Expand Down

0 comments on commit d98959b

Please sign in to comment.