From 4d231af19dd233a76bd6c8bc8cfcf45ebf459cba Mon Sep 17 00:00:00 2001 From: Mark Steward Date: Fri, 23 Feb 2024 02:33:31 +0000 Subject: [PATCH] Tell git to ignore directory ownership (fixes #2495) (#2496) * Tell git to ignore directory ownership in docker * Show usage instead of an error when no arguments are passed into docker --- entrypoint.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 746c963ad..d00e865bf 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -3,4 +3,11 @@ # Parse the last argument into an array of extra_args. mapfile -t extra_args < <(bash -c "for arg in ${*: -1}; do echo \$arg; done") -/usr/bin/trufflehog "${@: 1: $#-1}" "${extra_args[@]}" +# Directories might be owned by a user other than root +git config --global --add safe.directory '*' + +if [[ $# -eq 0 ]]; then + /usr/bin/trufflehog --help +else + /usr/bin/trufflehog "${@: 1: $#-1}" "${extra_args[@]}" +fi