Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation not updated on danger-swift commands #612

Open
DntPullALockett opened this issue Jun 18, 2024 · 0 comments
Open

Documentation not updated on danger-swift commands #612

DntPullALockett opened this issue Jun 18, 2024 · 0 comments

Comments

@DntPullALockett
Copy link

Danger Swift Version: 3.18.1

I am trying to run danger-swift in a normal Xcode project that does not rely on a Swift Package.
I added the Swift Package in another folder called "DangerPackage"

I have to run danger-swift from this folder but all of my source is not inside this folder or added to the package.

The docs of danger-swift state the following:

Current working directory

Many people prefer using Danger within a Swift Package via SPM, because is more performant.

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.

With the --cwd parameter you can specify a working directory. 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.

swift run danger-swift command --cwd path/to/working-directory
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 --cwd .. to tell Danger that it should look at the directory above where the command was executed to correctly invoke the tool.

This does not work as it outputs the error

Runner/main.swift:51: Fatal error: Danger Swift does not support this argument, it only handles ci, local, pr & edit'

Ultimately I am getting it to run, but it thinks my source files are inside the package Sources folder when they are not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant