forked from jenkins-infra/jenkins.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathawestruct
executable file
·31 lines (28 loc) · 1.2 KB
/
awestruct
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env bash
if [[ "$1" = "--dev" ]] ; then
./scripts/ruby bundle exec awestruct $@
else
mkdir -p build
./scripts/ruby bundle exec awestruct $@ 2> build/error.txt || {
cat build/error.txt >&2
exit 1
}
if [[ -n "$( grep '\(ERROR\|WARNING\)' build/error.txt )" ]] ; then
echo "Failing build due to warnings in log output:" >&2
sort -u build/error.txt >&2
if [[ -n "$( grep --fixed-strings 'skipping reference to missing attribute' build/error.txt )" ]] ; then
echo
echo "NOTE for 'Missing attribute error':"
echo " This means there is a some text that looks like '{some_name}',"
echo " but asciidoctor could not find an attribute called 'some_name'."
echo " If you expected there to be an attribute for substitution,"
echo " check the spelling."
echo
echo " To display some literal text such as \${ENV_VAR_NAME}"
echo " you will need to make it a passthrough: +\${ENV_VAR_NAME}+."
echo " To get monospace and passthrough, you must use"
echo " backtick and plus: \`+\${ENV_VAR_NAME}+\`"
fi
exit 1
fi
fi