From 0422746f849e68e94e7b87937afeec0a2fba44bb Mon Sep 17 00:00:00 2001 From: Zachary Lentz Date: Thu, 11 Apr 2024 18:04:23 +0000 Subject: [PATCH] BUG: add git safe directory for centrally deployed git repos --- scripts/docs_prompt.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/docs_prompt.sh b/scripts/docs_prompt.sh index 4da8fc2..87b2247 100755 --- a/scripts/docs_prompt.sh +++ b/scripts/docs_prompt.sh @@ -3,8 +3,14 @@ # Includes a human-readable shorthand, a url to the commit, and the current time and date THIS_SCRIPT="$(realpath "${0}")" THIS_DIR="$(dirname "${THIS_SCRIPT}")" +source "${THIS_DIR}"/paths.sh -VERSION="$(git -C "${THIS_DIR}" describe --tags)" +# Safe directory needed to check the git version, only apply once per user. +if ! git config --global --get-all safe.directory | grep "${ANSIBLE_ROOT}" &>/dev/null; then + git config --global --add safe.directory "${ANSIBLE_ROOT}" + echo "Added ${ANSIBLE_ROOT} as a git safe.directory to check the version." +fi +VERSION="$(git -C "${ANSIBLE_ROOT}" describe --tags)" URL="https://github.com/pcdshub/twincat-bsd-ansible/tree/${VERSION}" echo "If you made changes, please update the deployment docs (https://confluence.slac.stanford.edu/x/0IsFGg)"