Debian Codegraph @

scripts/validate-html-generation

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2
3 DIR="$( cd "$( dirnamescip-shell system . . dirname. "${BASH_SOURCE[0]}" )" && pwdscip-shell system . . pwd. )"
4 source "${DIR}/.validate"
5
6 IFS=$'\n'
7 files=( $(validate_diff --diff-filter=ACMR --name-only -- 'static/index.html' || truscip-shell system . . true.e) )
8 unset IFS
9
10 if [scip-shell system . . `[`. ${#files[@]} -gt 0 ]; then
11 # We run go generate to and see if we have a diff afterwards
12 goscip-shell system . . go. generate >/dev/nullscip-shell filesystem . . `/dev/null`.
13 # Let see if the working directory is clean
14 diffs="$(gitscip-shell system . . git. status --porcelain -- static.go 2>/dev/nullscip-shell filesystem . . `/dev/null`.)"
15 if [scip-shell system . . `[`. "$diffs" ]; then
16 {
17 echoscip-shell system . . echo. 'The result of go generate differs'
18 echoscip-shell system . . echo.
19 echoscip-shell system . . echo. "$diffs"
20 echoscip-shell system . . echo.
21 echoscip-shell system . . echo. 'Please re-run go generate'
22 echoscip-shell system . . echo.
23 } >&2
24 falsescip-shell system . . false.
25 else
26 echoscip-shell system . . echo. 'Congratulations! File generation is done correctly.'
27 fi
28 fi