Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- declare -i SUCCESS=0
- declare -i SEVERAL_ERRORS_IN_CSHARP_CODE=1
- declare -i SEVERAL_ERRORS_IN_MARKDOWN=2
- declare -i SEVERAL_UNIT_TESTS_FAILED=3
- logs_folder="logs"
- resharper_logs="$logs_folder/resharper-logs.log"
- jb inspectcode CommandLineArgumentParser.sln -s=warning -o="$resharper_logs" &> /dev/null
- grep -q '<Issues />' "$resharper_logs" || {
- echo "There are several errors in your C# code. Please consider $resharper_logs file for more info."
- exit "$SEVERAL_ERRORS_IN_CSHARP_CODE"
- }
- markdownlint_logs="$logs_folder/markdownlint-logs.log"
- markdownlint-cli2 -- *.md &> "$markdownlint_logs" || {
- echo "There are several errors in your Markdown code. Please consider $markdownlint_logs file for more info."
- exit "$SEVERAL_ERRORS_IN_MARKDOWN"
- }
- unittest_logs="$logs_folder/unittest-logs.log"
- dotnet test &> "$unittest_logs" || {
- echo "There are several failed unit tests for your C# code. Please consider $unittest_logs file for more info."
- exit "$SEVERAL_UNIT_TESTS_FAILED"
- }
- exit "$SUCCESS"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement