mirror of
https://github.com/xtool-org/xtool.git
synced 2026-11-05 20:13:58 +01:00
30 lines
728 B
Swift
30 lines
728 B
Swift
import ArgumentParser
|
|
import Foundation
|
|
import XKit
|
|
import PackLib
|
|
|
|
struct SetupCommand: AsyncParsableCommand {
|
|
static let configuration = CommandConfiguration(
|
|
commandName: "setup",
|
|
abstract: "Set up xtool for iOS development",
|
|
discussion: """
|
|
Authenticates with Apple if needed, then adds the iOS SDK to SwiftPM.
|
|
|
|
Equivalent to running `xtool auth && xtool sdk`
|
|
"""
|
|
)
|
|
|
|
func run() async throws {
|
|
try await SetupOperation().run()
|
|
}
|
|
}
|
|
|
|
struct SetupOperation {
|
|
var quiet = false
|
|
|
|
func run() async throws {
|
|
try await AuthOperation(logoutFromExisting: false, quiet: quiet).run()
|
|
try await EnsureSDKOperation(quiet: quiet).run()
|
|
}
|
|
}
|