Skip to content

Commit 136b515

Browse files
committed
eliminated dependency on NSHomeDirectory
1 parent c406a8f commit 136b515

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

Sources/Commands/SwiftTool.swift

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
import func Foundation.NSUserName
1212
import class Foundation.ProcessInfo
13-
import func Foundation.NSHomeDirectory
1413
import Dispatch
1514

1615
import ArgumentParser
@@ -354,34 +353,35 @@ public class SwiftTool {
354353
verbosity = Verbosity(rawValue: options.verbosity)
355354
Process.verbose = verbosity != .concise
356355
}
357-
356+
358357
static func postprocessArgParserResult(options: SwiftToolOptions, diagnostics: DiagnosticsEngine) throws {
359358
if options.chdir != nil {
360359
diagnostics.emit(warning: "'--chdir/-C' option is deprecated; use '--package-path' instead")
361360
}
362-
361+
363362
if options.multirootPackageDataFile != nil {
364363
diagnostics.emit(.unsupportedFlag("--multiroot-data-file"))
365364
}
366-
365+
367366
if options.useExplicitModuleBuild && !options.useIntegratedSwiftDriver {
368367
diagnostics.emit(error: "'--experimental-explicit-module-build' option requires '--use-integrated-swift-driver'")
369368
}
370-
369+
371370
if !options.archs.isEmpty && options.customCompileTriple != nil {
372371
diagnostics.emit(.mutuallyExclusiveArgumentsError(arguments: ["--arch", "--triple"]))
373372
}
374-
373+
375374
if options.netrcFilePath != nil {
376-
// --netrc-file option only supported on macOS >=10.13
377-
#if os(macOS)
378-
if #available(macOS 10.13, *) {
379-
// ok, check succeeds
380-
} else {
375+
// --netrc-file option only supported on macOS >=10.13
376+
#if os(macOS)
377+
if #available(macOS 10.13, *) {
378+
// ok, check succeeds
379+
} else {
381380
diagnostics.emit(error: "--netrc-file option is only supported on macOS >=10.13")
382-
}
383-
#else
384-
diagnostics.emit(error: "--netrc-file option is only supported on macOS >=10.13")
381+
}
382+
#else
383+
diagnostics.emit(error: "--netrc-file option is only supported on macOS >=10.13")
384+
#endif
385385
}
386386
}
387387

Tests/CommandsTests/PackageToolTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ final class PackageToolTests: XCTestCase {
5555
#if os(macOS)
5656
if #available(macOS 10.13, *) {
5757
// should succeed
58-
XCTAssert(try execute(["--netrc-file", "/Users/me/.hidden/.netrc"]).stdout.contains("Absolute path to netrc file"))
58+
XCTAssert(try execute(["--netrc-file", "/Users/me/.hidden/.netrc"]).stdout.contains("USAGE: swift package"))
5959
} else {
6060
verifyUnsupportedOSThrows()
6161
}

0 commit comments

Comments
 (0)