File tree Expand file tree Collapse file tree 3 files changed +27
-1
lines changed Expand file tree Collapse file tree 3 files changed +27
-1
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ COVERAGE_FILE=" coverage.out"
4
+ HTML_REPORT=" coverage.html"
5
+
6
+ echo " Executing tests and generating coverage report"
7
+ go test -coverprofile=" $COVERAGE_FILE "
8
+
9
+ if [[ $? -eq 0 ]]; then
10
+ echo " Generating HTML file..."
11
+
12
+ go tool cover -html=$COVERAGE_FILE -o $HTML_REPORT
13
+
14
+ if command -v xdg-open & > /dev/null; then
15
+ xdg-open $HTML_REPORT # Linux
16
+ elif command -v open & > /dev/null; then
17
+ open $HTML_REPORT # macOS
18
+ else
19
+ echo " Cannot open report automatically. Open the file $HTML_REPORT in your browser ."
20
+ fi
21
+ else
22
+ echo " An error occurred while trying to generate the coverage report."
23
+ fi
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ export " $( grep -v ' ^#' .env | xargs) "
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- sudo docker run -i yousan/swagger-yaml-to-html < swagger/swagger.yml > doc/api.html
3
+ sudo docker run --rm - i yousan/swagger-yaml-to-html < swagger/swagger.yml | sudo tee doc/api.html > /dev/null
You can’t perform that action at this time.
0 commit comments