From 3a6d6724c9a2743e02581881e97be77d099bd42e Mon Sep 17 00:00:00 2001 From: Ross Goldberg <484615+rgoldberg@users.noreply.github.com> Date: Mon, 21 Oct 2024 07:43:13 -0400 Subject: [PATCH] Reorder elements. Partial #592 Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com> --- .../SysCtlSystemCommand.swift | 22 +++++++++---------- Sources/mas/Mas.swift | 8 +++---- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Sources/mas/ExternalCommands/SysCtlSystemCommand.swift b/Sources/mas/ExternalCommands/SysCtlSystemCommand.swift index abd5fb8..1d04a2e 100644 --- a/Sources/mas/ExternalCommands/SysCtlSystemCommand.swift +++ b/Sources/mas/ExternalCommands/SysCtlSystemCommand.swift @@ -12,17 +12,6 @@ import Foundation /// /// See - https://ss64.com/osx/sysctl.html struct SysCtlSystemCommand: ExternalCommand { - var binaryPath: String - - let process = Process() - - let stdoutPipe = Pipe() - let stderrPipe = Pipe() - - init(binaryPath: String = "/usr/sbin/sysctl") { - self.binaryPath = binaryPath - } - static var isAppleSilicon: Bool = { let sysctl = Self() do { @@ -38,4 +27,15 @@ struct SysCtlSystemCommand: ExternalCommand { return sysctl.stdout.trimmingCharacters(in: .newlines) == "1" }() + + let process = Process() + + let stdoutPipe = Pipe() + let stderrPipe = Pipe() + + var binaryPath: String + + init(binaryPath: String = "/usr/sbin/sysctl") { + self.binaryPath = binaryPath + } } diff --git a/Sources/mas/Mas.swift b/Sources/mas/Mas.swift index 5fb8dda..89aeacb 100644 --- a/Sources/mas/Mas.swift +++ b/Sources/mas/Mas.swift @@ -35,10 +35,6 @@ struct Mas: ParsableCommand { ] ) - func validate() throws { - Self.initialize() - } - static func initialize() { PromiseKit.conf.Q.map = .global() PromiseKit.conf.Q.return = .global() @@ -54,6 +50,10 @@ struct Mas: ParsableCommand { } } } + + func validate() throws { + Self.initialize() + } } typealias AppID = UInt64