From 35b572acf424c8bac03c28e26845175eedbc5aca Mon Sep 17 00:00:00 2001 From: Pyry Jahkola Date: Fri, 11 Apr 2025 12:20:29 +0300 Subject: [PATCH] Allow `--directory=path` option refer to relative paths Fixes: #303 --- Sources/xcodes/App.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/xcodes/App.swift b/Sources/xcodes/App.swift index 95e9fff..436e052 100644 --- a/Sources/xcodes/App.swift +++ b/Sources/xcodes/App.swift @@ -8,7 +8,7 @@ import Path import Rainbow func getDirectory(possibleDirectory: String?, default: Path = Path.root.join("Applications")) -> Path { - let directory = possibleDirectory.flatMap(Path.init) ?? + let directory = possibleDirectory.flatMap { Path($0) ?? Path.cwd / $0 } ?? ProcessInfo.processInfo.environment["XCODES_DIRECTORY"].flatMap(Path.init) ?? `default` guard directory.isDirectory else {