File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -573,6 +573,10 @@ function common::populate_tool_cache {
573573 local -r cache_dir=" $5 "
574574 local -r cached_bin=" $6 "
575575
576+ if [[ -x $cached_bin ]]; then
577+ return 0
578+ fi
579+
576580 local tmp_dir
577581 tmp_dir=$( mktemp -d " ${cache_dir} .XXXXXXXXXX" ) || {
578582 common::colorify " red" " ERROR: Failed to create a temp directory for '$tool_name ' version '$version '."
@@ -595,12 +599,6 @@ function common::populate_tool_cache {
595599 return 1
596600 fi
597601
598- # Someone else may have already won the race - use their result.
599- if [[ -x $cached_bin ]]; then
600- rm -rf " $tmp_dir "
601- return 0
602- fi
603-
604602 # Atomic `rename(2)`: both sides are plain files, so a concurrent
605603 # reader never sees a partial write.
606604 if ! mv " $tmp_dir /$( basename " $cached_bin " ) " " $cached_bin " 2> /dev/null; then
You can’t perform that action at this time.
0 commit comments