Skip to content

Commit

Permalink
Fix: determine whether the destination path already exists before clone
Browse files Browse the repository at this point in the history
If directory ${GOPATH}/src/github.com/google/licenseclassifier exists and
is not empty we should skip clone again or will cause an error.

Related Issue: tektoncd/pipeline#5193

Signed-off-by: yuzhipeng <yuzp1996@qq.com>
  • Loading branch information
yuzp1996 committed Aug 10, 2022
1 parent 5dbf210 commit fa351b7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tekton/images/test-runner/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,14 @@ set -o errexit
set -o nounset
set -o pipefail

# Workaround for https://github.com/google/licenseclassifier/issues/20
git clone https://github.com/google/licenseclassifier ${GOPATH}/src/github.com/google/licenseclassifier
DIR="${GOPATH}/src/github.com/google/licenseclassifier"

if [ "$(ls -A $DIR)" ]; then
echo "$DIR is not Empty. Skip clone..."
else
# Workaround for https://github.com/google/licenseclassifier/issues/20
git clone https://github.com/google/licenseclassifier $DIR
fi

# actually start bootstrap and the job, under the runner (which handles dind etc.)
/usr/local/bin/runner.sh "$@"

0 comments on commit fa351b7

Please sign in to comment.