Fix link to github repo in buildinfo.json

This commit is contained in:
Patrick Smith 2018-09-25 11:24:39 -04:00
parent 2bbb859ad8
commit a933a9d71e

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# #
# script/generate_build_info: Generates buildinfo.html and buildinfo.json and # script/generate_build_info: Generates buildinfo.html and buildinfo.json and
# places them in a publically accessable static asset # places them in a publically accessable static asset
# folder # folder
@ -36,7 +36,7 @@ echo "Gathering info from git..."
COMMIT_AUTHOR=$(git log -1 --pretty=%aN) COMMIT_AUTHOR=$(git log -1 --pretty=%aN)
COMMIT_AUTHOR_EMAIL=$(git log -1 --pretty=%aE) COMMIT_AUTHOR_EMAIL=$(git log -1 --pretty=%aE)
GIT_SHA=$(git rev-parse HEAD) GIT_SHA=$(git rev-parse HEAD)
# Escape all double quotes in commit message and switch newlines for \n # Escape all double quotes in commit message and switch newlines for \n
# (for JSON compatability) # (for JSON compatability)
COMMIT_MESSAGE_JSON=$(git log -1 --pretty=format:%B | sed -e 's#\([^\\]\)"#\1\\"#g' | awk 1 ORS='\\n') COMMIT_MESSAGE_JSON=$(git log -1 --pretty=format:%B | sed -e 's#\([^\\]\)"#\1\\"#g' | awk 1 ORS='\\n')
# Escape all < and > characters in commit message and trade newlines for <BR/> tags # Escape all < and > characters in commit message and trade newlines for <BR/> tags
@ -44,7 +44,7 @@ COMMIT_MESSAGE_HTML=$(git log -1 --pretty=format:%B | sed -e 's#>#&gt;#g' | sed
# Assemble https based git repo url # Assemble https based git repo url
GIT_REPO=$(git config --get remote.origin.url | cut -d ':' -f 2) GIT_REPO=$(git config --get remote.origin.url | cut -d ':' -f 2)
GIT_URL="https://github.com/${GIT_REPO}" GIT_URL="https:${GIT_REPO}"
# Drop the trailing .git for generating github links # Drop the trailing .git for generating github links
GITHUB_BASE_URL="${GIT_URL%.git}" GITHUB_BASE_URL="${GIT_URL%.git}"
GITHUB_COMMIT_URL="${GITHUB_BASE_URL}/commit/${GIT_SHA}" GITHUB_COMMIT_URL="${GITHUB_BASE_URL}/commit/${GIT_SHA}"