Skip to content

Commit ceabfe5

Browse files
authored
Merge pull request #552 from dlewandaDK/patch-1
2 parents 7d61a4a + 6eb1444 commit ceabfe5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,15 +221,19 @@ danger-swift command --danger-js-path path/to/danger-js
221221

222222
#### Current working directory
223223

224-
Many people prefers using the SPM Danger configuration, because is more performing.
225-
But having a `Package.swift` on your root folder can be annoying, especially now that Xcode (from 11) doesn't put on the recents list an `xcproj` (or `xcworkspace`) when there is a `Package.swift` in the same folder.
224+
Many people prefer using Danger within a Swift Package via SPM, because is more performant.
225+
226+
When doing so, however, having a `Package.swift` in the root folder can be annoying, especially now that Xcode (since Xcode 11) doesn't show a `xcproj` (or `xcworkspace`) on the Open Recents menu when there is a `Package.swift` in the same folder.
227+
226228
With the `--cwd` parameter you can specify a working directory.
227-
This allows you to have your `Package.swift` in another directory and still run danger-swift as it was executed from your project root directory.
229+
This allows you to have your `Package.swift` in another directory and still run danger-swift as it was executed from your project root directory.
228230

229231
```swift
230232
swift run danger-swift command --cwd path/to/working-directory
231233
```
232234

235+
Note that to do this, you must run `danger-swift` from the directory where the `Package.swift` is located, and pass the top-level directory relative to this directory to the `--cwd` command-line switch. For example, if you create a folder named **Danger** in the top level of your repo for these files, you would need to `cd Danger` and then run the command `[swift run] danger-swift cmd <cmd parameters> --cwd ..` to tell Danger that it should look at the directory above where the command was executed to correctly invoke the tool.
236+
233237
#### Dev
234238

235239
You need to be using Xcode >= 13.2.1.

0 commit comments

Comments
 (0)