diff --git a/Xcodes.xcodeproj/project.pbxproj b/Xcodes.xcodeproj/project.pbxproj index f0a8f89..2a053a2 100644 --- a/Xcodes.xcodeproj/project.pbxproj +++ b/Xcodes.xcodeproj/project.pbxproj @@ -55,9 +55,7 @@ CABFA9CF2592EEEA00380FEE /* Process.swift in Sources */ = {isa = PBXBuildFile; fileRef = CABFA9B42592EEEA00380FEE /* Process.swift */; }; CABFA9DF2592F07A00380FEE /* Path in Frameworks */ = {isa = PBXBuildFile; productRef = CABFA9DE2592F07A00380FEE /* Path */; }; CABFA9E42592F08E00380FEE /* Version in Frameworks */ = {isa = PBXBuildFile; productRef = CABFA9E32592F08E00380FEE /* Version */; }; - CABFA9E92592F0B400380FEE /* PromiseKit in Frameworks */ = {isa = PBXBuildFile; productRef = CABFA9E82592F0B400380FEE /* PromiseKit */; }; CABFA9EE2592F0CC00380FEE /* SwiftSoup in Frameworks */ = {isa = PBXBuildFile; productRef = CABFA9ED2592F0CC00380FEE /* SwiftSoup */; }; - CABFA9F32592F0E400380FEE /* PMKFoundation in Frameworks */ = {isa = PBXBuildFile; productRef = CABFA9F22592F0E400380FEE /* PMKFoundation */; }; CABFA9F82592F0F900380FEE /* KeychainAccess in Frameworks */ = {isa = PBXBuildFile; productRef = CABFA9F72592F0F900380FEE /* KeychainAccess */; }; CABFA9FD2592F13300380FEE /* LegibleError in Frameworks */ = {isa = PBXBuildFile; productRef = CABFA9FC2592F13300380FEE /* LegibleError */; }; CABFAA2C2592FBFC00380FEE /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CABFAA2A2592FBFC00380FEE /* SettingsView.swift */; }; @@ -218,11 +216,9 @@ buildActionMask = 2147483647; files = ( CABFA9E42592F08E00380FEE /* Version in Frameworks */, - CABFA9E92592F0B400380FEE /* PromiseKit in Frameworks */, CABFA9FD2592F13300380FEE /* LegibleError in Frameworks */, CA9FF86D25951C6E00E47BAF /* XCModel in Frameworks */, CABFA9F82592F0F900380FEE /* KeychainAccess in Frameworks */, - CABFA9F32592F0E400380FEE /* PMKFoundation in Frameworks */, CAA1CB2D255A5262003FD669 /* AppleAPI in Frameworks */, CABFA9DF2592F07A00380FEE /* Path in Frameworks */, CABFA9EE2592F0CC00380FEE /* SwiftSoup in Frameworks */, @@ -479,9 +475,7 @@ CAA1CB2C255A5262003FD669 /* AppleAPI */, CABFA9DE2592F07A00380FEE /* Path */, CABFA9E32592F08E00380FEE /* Version */, - CABFA9E82592F0B400380FEE /* PromiseKit */, CABFA9ED2592F0CC00380FEE /* SwiftSoup */, - CABFA9F22592F0E400380FEE /* PMKFoundation */, CABFA9F72592F0F900380FEE /* KeychainAccess */, CABFA9FC2592F13300380FEE /* LegibleError */, CA9FF86C25951C6E00E47BAF /* XCModel */, @@ -542,9 +536,7 @@ packageReferences = ( CABFA9DD2592F07A00380FEE /* XCRemoteSwiftPackageReference "Path" */, CABFA9E22592F08E00380FEE /* XCRemoteSwiftPackageReference "Version" */, - CABFA9E72592F0B400380FEE /* XCRemoteSwiftPackageReference "PromiseKit" */, CABFA9EC2592F0CC00380FEE /* XCRemoteSwiftPackageReference "SwiftSoup" */, - CABFA9F12592F0E400380FEE /* XCRemoteSwiftPackageReference "Foundation" */, CABFA9F62592F0F900380FEE /* XCRemoteSwiftPackageReference "KeychainAccess" */, CABFA9FB2592F13300380FEE /* XCRemoteSwiftPackageReference "LegibleError" */, CA9FF86B25951C6E00E47BAF /* XCRemoteSwiftPackageReference "data" */, @@ -589,6 +581,8 @@ inputFileListPaths = ( ); inputPaths = ( + "$(SRCROOT)/Xcodes.xcodeproj", + "$(SRCROOT)/**/*.LICENSE", ); name = "Generate Acknowledgements"; outputFileListPaths = ( @@ -1145,14 +1139,6 @@ minimumVersion = 1.0.3; }; }; - CABFA9E72592F0B400380FEE /* XCRemoteSwiftPackageReference "PromiseKit" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/mxcl/PromiseKit"; - requirement = { - kind = upToNextMinorVersion; - minimumVersion = 6.8.3; - }; - }; CABFA9EC2592F0CC00380FEE /* XCRemoteSwiftPackageReference "SwiftSoup" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/scinfu/SwiftSoup"; @@ -1161,14 +1147,6 @@ minimumVersion = 2.0.0; }; }; - CABFA9F12592F0E400380FEE /* XCRemoteSwiftPackageReference "Foundation" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/PromiseKit/Foundation"; - requirement = { - kind = upToNextMinorVersion; - minimumVersion = 3.3.1; - }; - }; CABFA9F62592F0F900380FEE /* XCRemoteSwiftPackageReference "KeychainAccess" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/kishikawakatsumi/KeychainAccess"; @@ -1207,21 +1185,11 @@ package = CABFA9E22592F08E00380FEE /* XCRemoteSwiftPackageReference "Version" */; productName = Version; }; - CABFA9E82592F0B400380FEE /* PromiseKit */ = { - isa = XCSwiftPackageProductDependency; - package = CABFA9E72592F0B400380FEE /* XCRemoteSwiftPackageReference "PromiseKit" */; - productName = PromiseKit; - }; CABFA9ED2592F0CC00380FEE /* SwiftSoup */ = { isa = XCSwiftPackageProductDependency; package = CABFA9EC2592F0CC00380FEE /* XCRemoteSwiftPackageReference "SwiftSoup" */; productName = SwiftSoup; }; - CABFA9F22592F0E400380FEE /* PMKFoundation */ = { - isa = XCSwiftPackageProductDependency; - package = CABFA9F12592F0E400380FEE /* XCRemoteSwiftPackageReference "Foundation" */; - productName = PMKFoundation; - }; CABFA9F72592F0F900380FEE /* KeychainAccess */ = { isa = XCSwiftPackageProductDependency; package = CABFA9F62592F0F900380FEE /* XCRemoteSwiftPackageReference "KeychainAccess" */; diff --git a/Xcodes.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Xcodes.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index fba9785..880f3a4 100644 --- a/Xcodes.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Xcodes.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -10,15 +10,6 @@ "version": null } }, - { - "package": "PMKFoundation", - "repositoryURL": "https://github.com/PromiseKit/Foundation", - "state": { - "branch": null, - "revision": "1a276e598dac59489ed904887e0740fa75e571e0", - "version": "3.3.4" - } - }, { "package": "KeychainAccess", "repositoryURL": "https://github.com/kishikawakatsumi/KeychainAccess", @@ -46,15 +37,6 @@ "version": "0.16.3" } }, - { - "package": "PromiseKit", - "repositoryURL": "https://github.com/mxcl/PromiseKit", - "state": { - "branch": null, - "revision": "1c296a8637838901d2b01e4c46875ee749506133", - "version": "6.8.5" - } - }, { "package": "SwiftSoup", "repositoryURL": "https://github.com/scinfu/SwiftSoup", diff --git a/Xcodes/Backend/Environment.swift b/Xcodes/Backend/Environment.swift index 99f84be..26555ad 100644 --- a/Xcodes/Backend/Environment.swift +++ b/Xcodes/Backend/Environment.swift @@ -1,7 +1,5 @@ import Combine import Foundation -import PromiseKit -import PMKFoundation import Path import AppleAPI import KeychainAccess diff --git a/Xcodes/Backend/Process.swift b/Xcodes/Backend/Process.swift index 779f151..b800d53 100644 --- a/Xcodes/Backend/Process.swift +++ b/Xcodes/Backend/Process.swift @@ -1,7 +1,5 @@ import Combine import Foundation -import PromiseKit -import PMKFoundation import Path public typealias ProcessOutput = (status: Int32, out: String, err: String) @@ -71,6 +69,10 @@ extension Process { let output = String(data: stdout.fileHandleForReading.readDataToEndOfFile(), encoding: .utf8) ?? "" let error = String(data: stderr.fileHandleForReading.readDataToEndOfFile(), encoding: .utf8) ?? "" + + guard process.terminationReason == .exit, process.terminationStatus == 0 else { + return promise(.failure(ProcessExecutionError(process: process, standardOutput: output, standardError: error))) + } promise(.success((process.terminationStatus, output, error))) } catch { @@ -83,3 +85,9 @@ extension Process { .eraseToAnyPublisher() } } + +struct ProcessExecutionError: Error { + let process: Process + let standardOutput: String + let standardError: String +} diff --git a/Xcodes/Frontend/XcodeList/XcodeListView.swift b/Xcodes/Frontend/XcodeList/XcodeListView.swift index c3c564f..6293083 100644 --- a/Xcodes/Frontend/XcodeList/XcodeListView.swift +++ b/Xcodes/Frontend/XcodeList/XcodeListView.swift @@ -1,6 +1,5 @@ import SwiftUI import Version -import PromiseKit struct XcodeListView: View { @EnvironmentObject var appState: AppState diff --git a/Xcodes/Resources/Licenses.rtf b/Xcodes/Resources/Licenses.rtf index 569081d..3dc4006 100644 --- a/Xcodes/Resources/Licenses.rtf +++ b/Xcodes/Resources/Licenses.rtf @@ -4,33 +4,7 @@ {\*\expandedcolortbl;;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\partightenfactor0 -\f0\fs34 \cf0 PromiseKit\ -\ - -\fs26 Copyright 2016-present, Max Howell; mxcl@me.com\ -\ -Permission is hereby granted, free of charge, to any person obtaining a\ -copy of this software and associated documentation files (the\ -"Software"), to deal in the Software without restriction, including\ -without limitation the rights to use, copy, modify, merge, publish,\ -distribute, sublicense, and/or sell copies of the Software, and to\ -permit persons to whom the Software is furnished to do so, subject to\ -the following conditions:\ -\ -The above copyright notice and this permission notice shall be included\ -in all copies or substantial portions of the Software.\ -\ -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\ -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\ -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\ -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\ -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\ -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\ -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\ -\ -\ - -\fs34 SwiftSoup\ +\f0\fs34 \cf0 SwiftSoup\ \ \fs26 MIT License\ @@ -57,32 +31,6 @@ SOFTWARE.\ \ \ -\fs34 Foundation\ -\ - -\fs26 Copyright 2018-present, Max Howell; mxcl@me.com\ -\ -Permission is hereby granted, free of charge, to any person obtaining a\ -copy of this software and associated documentation files (the\ -"Software"), to deal in the Software without restriction, including\ -without limitation the rights to use, copy, modify, merge, publish,\ -distribute, sublicense, and/or sell copies of the Software, and to\ -permit persons to whom the Software is furnished to do so, subject to\ -the following conditions:\ -\ -The above copyright notice and this permission notice shall be included\ -in all copies or substantial portions of the Software.\ -\ -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\ -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\ -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\ -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\ -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\ -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\ -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\ -\ -\ - \fs34 Path.swift\ \