Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update jdk-8/mvn-entrypoint.sh fix https://github.com/carlossg/docker… #135

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions jdk-8/mvn-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,16 @@ copy_reference_files() {
if cp --help 2>&1 | grep -q reflink ; then
reflink="--reflink=auto"
fi
if [ -n "$(find "${MAVEN_CONFIG}/repository" -maxdepth 0 -type d -empty 2>/dev/null)" ] ; then
if [ ! -d "${MAVEN_CONFIG}/repository" -o 1 = "$(find "${MAVEN_CONFIG}/repository" -maxdepth 1 -type d 2>/dev/null | wc -l)" ] ; then
# destination is empty...
echo "--- Copying all files to ${MAVEN_CONFIG} at $(date)" >> "${log}"
cp -rv ${reflink} . "${MAVEN_CONFIG}" >> "${log}"

local verbose="" # -v is not supported in alpine / busybox
if cp --help 2>&1 | grep -q "\-v" ; then
verbose="-v"
fi

cp -r ${verbose} ${reflink} . "${MAVEN_CONFIG}" >> "${log}"
else
# destination is non-empty, copy file-by-file
echo "--- Copying individual files to ${MAVEN_CONFIG} at $(date)" >> "${log}"
Expand Down Expand Up @@ -47,4 +53,4 @@ unset MAVEN_CONFIG
cd "${owd}"
unset owd

exec "$@"
exec "$@"