Last active
June 18, 2022 20:18
-
-
Save wendreof/920ec6d711eb9a5b8b5ee33208cad1c2 to your computer and use it in GitHub Desktop.
.Net Hooks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo "Formattng the .cs files changed... ✨✨✨" | |
# Valida HoosPath | |
git config core.hooks | |
# Format the code | |
FILES=$(git diff --cached --name-only --diff-filter=ACM "*.cs") | |
if [ -n "$FILES" ] | |
then | |
dotnet-format webApi_Pix.sln --include $FILES | |
echo "$FILES" | xargs git add | |
fi | |
if [ $? -ne 0 ]; then | |
echo "Wasn't possible format your changes...." | |
exit 1 | |
fi | |
echo "Formatting done 😎😎" | |
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo "Building before push ⚒️⚒️⚒️" | |
dotnet build | |
echo "Build done!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment