We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fc61854 commit 722d35fCopy full SHA for 722d35f
test/bin/manage_build_cache.sh
@@ -229,7 +229,15 @@ action_keep() {
229
# Get the last contents with the ${TAG_SUBDIR} default
230
local -r last_dir="$(action_getlast | awk '/LAST:/ {print $NF}')"
231
232
- for sub_dir in $(run_aws_cli s3 ls "${top_dir}/" | awk '{print $NF}'); do
+ # Get all sub-directories in the top directory
233
+ local -r sub_dirs=$(run_aws_cli s3 ls "${top_dir}/" | grep '/$' | awk '{print $NF}')
234
+ # Skip if only one sub-directory exists
235
+ if [ "$(echo "${sub_dirs}" | wc -w)" -eq 1 ] ; then
236
+ echo "Only one sub-directory found in '${top_dir}', keeping it"
237
+ return 0
238
+ fi
239
+
240
+ for sub_dir in ${sub_dirs}; do
241
if [ "${sub_dir}" = "last" ] ; then
242
continue
243
fi
0 commit comments