Skip to content

Conversation

@hubertgrzeskowiak
Copy link
Contributor

Just adding some useful stuff to the README that took me a while to figure out


### Docker
```sh
docker run --rm -v "${PWD}:/code" -w /code ghcr.io/danger/danger-kotlin:1.3.3 danger-kotlin local
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would theoretically also work without changing the work directory, but the default dir is the root, so mounting the current working directory there could override existing files. Mounting it in a new dir and using that for running the command seems much safer.

- Make sure the script template `DangerFileScript` is active and above the default `Kotlin Script`
- Apply changes
- If opening the `Dangerfile.df.kts` the autocomplete and syntax highlighting doesn't work, try to reboot your IDE or open the Dangerfile from your IDE as a single file.
- If it still doesn't work, go to `Help -> Edit Custom VM Options...` and add `-Dkotlin.script.classpath=<path>/danger-kotlin.jar` (replace the `<path>` with the absolute path to the JAR). Then restart the IDE.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually ran this tool without installing. I got the JAR from the Docker image using

docker run --rm ghcr.io/danger/danger-kotlin:1.3.3 gzip --stdout /usr/local/lib/danger/danger-kotlin.jar | gunzip > danger-kotlin.jar

@Vacxe
Copy link
Member

Vacxe commented Mar 10, 2025

Thanks mate for the contribution. Always happy to merge a doco uplift

@Vacxe Vacxe merged commit 2fc3cf3 into danger:master Mar 10, 2025
3 checks passed
@hubertgrzeskowiak hubertgrzeskowiak deleted the patch-1 branch March 26, 2025 00:01
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

Successfully merging this pull request may close these issues.

2 participants