8000 create Spotless Pre-Commit hook · Issue #1 · kanake10/Cocktails · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

create Spotless Pre-Commit hook #1

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

Open
kanake10 opened this issue Jun 5, 2022 · 0 comments
Open

create Spotless Pre-Commit hook #1

kanake10 opened this issue Jun 5, 2022 · 0 comments

Comments

@kanake10
Copy link
Owner
kanake10 commented Jun 5, 2022

//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()
}

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
0