Cocktails icon indicating copy to clipboard operation
Cocktails copied to clipboard

create Spotless Pre-Commit hook

Open kanake10 opened this issue 2 years ago • 0 comments

//rough example

task createSpotlessPreCommitHook() { def gitHooksDirectory = new File("$project.rootDir/.git/hooks/") if (!gitHooksDirectory.exists()) gitHooksDirectory.mkdirs() new File("$project.rootDir/.git/hooks", "pre-commit").text = """ #!/bin/bash echo "Running spotless check" ./gradlew spotlessApply """ "chmod +x .git/hooks/pre-commit".execute() }

kanake10 avatar Jun 05 '22 14:06 kanake10