More small changes
- Commit
ca540c88724cc4957e4410fc38f36ea825e17807- Author
- Kabir Oberai <[email protected]>
- When
- 2024-12-07 06:24 UTC (1 year ago)
- Parents
fc24d0f
Diff
Sources/Supersign/Model/Certificate.swift
diff --git a/Sources/Supersign/Model/Certificate/Certificate.swift b/Sources/Supersign/Model/Certificate.swiftsimilarity index 100%rename from Sources/Supersign/Model/Certificate/Certificate.swiftrename to Sources/Supersign/Model/Certificate.swift
Sources/Supersign/Model/Keypair.swift
diff --git a/Sources/Supersign/Model/Keypair/Keypair.swift b/Sources/Supersign/Model/Keypair.swiftsimilarity index 100%rename from Sources/Supersign/Model/Keypair/Keypair.swiftrename to Sources/Supersign/Model/Keypair.swift
Sources/Supersign/Model/Mobileprovision.swift
diff --git a/Sources/Supersign/Model/Mobileprovision/Mobileprovision.swift b/Sources/Supersign/Model/Mobileprovision.swiftsimilarity index 100%rename from Sources/Supersign/Model/Mobileprovision/Mobileprovision.swiftrename to Sources/Supersign/Model/Mobileprovision.swift
Sources/SupersignCLISupport/ConnectionOptions.swift
diff --git a/Sources/SupersignCLISupport/ConnectionOptions.swift b/Sources/SupersignCLISupport/ConnectionOptions.swiftindex c1b55de..a186680 100644--- a/Sources/SupersignCLISupport/ConnectionOptions.swift+++ b/Sources/SupersignCLISupport/ConnectionOptions.swift@@ -3,21 +3,20 @@ import Supersign import ArgumentParser struct ConnectionOptions: ParsableArguments {- @Option(name: .shortAndLong) var udid: String?+ struct WithoutSearchMode: ParsableArguments {+ @Option(name: .shortAndLong) var udid: String?+ } + @OptionGroup var base: WithoutSearchMode @Flag var search: ClientDevice.SearchMode = .all - init() {}-- init(- udid: String?,- search: ClientDevice.SearchMode = .all- ) {- self.udid = udid- self.search = search+ func client() async throws -> ClientDevice {+ try await base.client(searchMode: search) }+} - func client() async throws -> ClientDevice {+extension ConnectionOptions.WithoutSearchMode {+ func client(searchMode search: ClientDevice.SearchMode) async throws -> ClientDevice { print("Waiting for device to be connected...") let stream = try await ClientDevice.search(mode: search)
Sources/SupersignCLISupport/SuperchargeCommand.swift
diff --git a/Sources/SupersignCLISupport/SuperchargeCommand.swift b/Sources/SupersignCLISupport/SuperchargeCommand.swiftindex 3343348..2f25c2e 100644--- a/Sources/SupersignCLISupport/SuperchargeCommand.swift+++ b/Sources/SupersignCLISupport/SuperchargeCommand.swift@@ -8,7 +8,7 @@ struct InstallSuperchargeCommand: AsyncParsableCommand { abstract: "Install Supercharge" ) - @Option(name: .shortAndLong) var udid: String?+ @OptionGroup var connectionOptions: ConnectionOptions.WithoutSearchMode func run() async throws { guard let app = SupersignCLI.config.superchargeApp else {@@ -17,14 +17,14 @@ struct InstallSuperchargeCommand: AsyncParsableCommand { let auth = try AuthToken.saved() - let client = try await ConnectionOptions(udid: udid, search: .usb).client()+ let client = try await connectionOptions.client(searchMode: .usb) print("Installing to device: \(client.deviceName) (udid: \(client.udid))") let installDelegate = SupersignCLIDelegate(preferredTeam: nil) let installer = IntegratedInstaller( udid: client.udid,- lookupMode: .only(.usb),+ lookupMode: .only(client.connectionType), appleID: auth.appleID, token: auth.dsToken, configureDevice: true,