File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -86,15 +86,13 @@ jobs:
86
86
if echo "${input}" | jq -e '.append_git_rev_to_version' > /dev/null; then
87
87
echo "Appending git rev to version string in ${src}"
88
88
89
- # The sed command handles the following transformations:
90
89
# `version: 1.3` --> `version: 1.3 (Git commit xyz)`
91
90
# `version: "2.0"` --> `version: "2.0 (Git commit xyz)"`
92
91
sed -i -r "/^---$/,/^---$/s/^(version: \"?[^\"]*)(\"?)$/\1 (Git commit ${commit_hash})\2/g" "${src}"
93
92
fi
94
93
95
- if echo "${input}" | jq -e 'has("gh_pages_html")' > /dev/null; then
96
- gh_pages_html=$(echo "${input}" | jq -r '.gh_pages_html')
97
-
94
+ gh_pages_html=$(echo "${input}" | jq -e -r '.gh_pages_html')
95
+ if [ $? -eq 0 ]; then
98
96
echo "Rendering ${src} to gh-pages/${gh_pages_html}/index.html"
99
97
100
98
(cd "${src_dirname}" && exec \
@@ -113,9 +111,8 @@ jobs:
113
111
mv "${src_dirname}/index.html" "gh-pages/${gh_pages_html}/"
114
112
fi
115
113
116
- if echo "${input}" | jq -e 'has("gh_pages_pdf")' > /dev/null; then
117
- gh_pages_pdf=$(echo "${input}" | jq -r '.gh_pages_pdf')
118
-
114
+ gh_pages_pdf=$(echo "${input}" | jq -e -r '.gh_pages_pdf')
115
+ if [ $? -eq 0 ]; then
119
116
# [parent dir name]_[filename sans extension]_[git commit hash].pdf
120
117
pdf_name="$(basename "${src_dirname}")_${src_basename%.*}_${commit_hash}.pdf"
121
118
You can’t perform that action at this time.
0 commit comments