diff --git a/Documentation/SwiftlyDocs.docc/swiftly-cli-reference.md b/Documentation/SwiftlyDocs.docc/swiftly-cli-reference.md index fc2fb289..31e2fd1e 100644 --- a/Documentation/SwiftlyDocs.docc/swiftly-cli-reference.md +++ b/Documentation/SwiftlyDocs.docc/swiftly-cli-reference.md @@ -232,7 +232,7 @@ swiftly uninstall [--assume-yes] [--verbose] [--version] [--help] *The toolchain(s) to uninstall.* -The toolchain selector provided determines which toolchains to uninstall. Specific toolchains can be uninstalled by using their full names as the selector, for example a full stable release version with patch (a.b.c): +The toolchain selector provided determines which toolchains to uninstall. Specific toolchains can be uninstalled by using their full names as the selector, for example a full stable release version with patch (a.b.c): $ swiftly uninstall 5.2.1 diff --git a/Sources/MacOSPlatform/MacOS.swift b/Sources/MacOSPlatform/MacOS.swift index dd72af1c..47f66bd1 100644 --- a/Sources/MacOSPlatform/MacOS.swift +++ b/Sources/MacOSPlatform/MacOS.swift @@ -148,7 +148,9 @@ public struct MacOS: Platform { public func uninstall(_ ctx: SwiftlyCoreContext, _ toolchain: ToolchainVersion, verbose: Bool) async throws { - await ctx.print("Uninstalling package in user home directory...") + if verbose { + await ctx.print("Uninstalling package in user home directory... ") + } let toolchainDir = self.swiftlyToolchainsDir(ctx) / "\(toolchain.identifier).xctoolchain" diff --git a/Sources/Swiftly/Uninstall.swift b/Sources/Swiftly/Uninstall.swift index 75b9ff4f..a329142a 100644 --- a/Sources/Swiftly/Uninstall.swift +++ b/Sources/Swiftly/Uninstall.swift @@ -12,7 +12,7 @@ struct Uninstall: SwiftlyCommand { The toolchain selector provided determines which toolchains to uninstall. Specific \ toolchains can be uninstalled by using their full names as the selector, for example \ - a full stable release version with patch (a.b.c): + a full stable release version with patch (a.b.c): $ swiftly uninstall 5.2.1 @@ -129,7 +129,7 @@ struct Uninstall: SwiftlyCommand { } static func execute(_ ctx: SwiftlyCoreContext, _ toolchain: ToolchainVersion, _ config: inout Config, verbose: Bool) async throws { - await ctx.print("Uninstalling \(toolchain)...", terminator: "") + await ctx.print("Uninstalling \(toolchain)... ", terminator: "") config.installedToolchains.remove(toolchain) // This is here to prevent the inUse from referencing a toolchain that is not installed if config.inUse == toolchain { diff --git a/Tests/SwiftlyTests/RunTests.swift b/Tests/SwiftlyTests/RunTests.swift index bf995b9c..09546e18 100644 --- a/Tests/SwiftlyTests/RunTests.swift +++ b/Tests/SwiftlyTests/RunTests.swift @@ -68,15 +68,13 @@ import Testing #expect(["swift", "+1.2.3", "build"] == command) #expect(nil == selector) - do { - let _ = try Run.extractProxyArguments(command: ["+1.2.3"]) - #expect(false) - } catch {} + #expect(throws: SwiftlyError.self) { + try Run.extractProxyArguments(command: ["+1.2.3"]) + } - do { - let _ = try Run.extractProxyArguments(command: []) - #expect(false) - } catch {} + #expect(throws: SwiftlyError.self) { + try Run.extractProxyArguments(command: []) + } (command, selector) = try Run.extractProxyArguments(command: ["swift", "+1.2.3", "build"]) #expect(["swift", "build"] == command)