Modern Apps git

xtool.git

Public
git clone https://git.maproj.org/xtool.git
appstore-distribution ▾

xtool.git / Sources / XToolSupport / SetupCommand.swift

SetupCommand.swift29 lines · 728 BRaw
1import ArgumentParser
2import Foundation
3import XKit
4import PackLib
5
6struct SetupCommand: AsyncParsableCommand {
7 static let configuration = CommandConfiguration(
8 commandName: "setup",
9 abstract: "Set up xtool for iOS development",
10 discussion: """
11 Authenticates with Apple if needed, then adds the iOS SDK to SwiftPM.
12
13 Equivalent to running `xtool auth && xtool sdk`
14 """
15 )
16
17 func run() async throws {
18 try await SetupOperation().run()
19 }
20}
21
22struct SetupOperation {
23 var quiet = false
24
25 func run() async throws {
26 try await AuthOperation(logoutFromExisting: false, quiet: quiet).run()
27 try await EnsureSDKOperation(quiet: quiet).run()
28 }
29}