Add -depth option to find -exec rm invocations

Since find with -delete is not portable, we instead invoke find with -exec and rm * {}. it looks like this is (alone) might not be strictly portable either, since the order in which dirs are processed could lead find to search in a directory that has already been deleted.

See https://gitlab.com/gitlab-com/ops-sub-department/zos-runner/phase-1-certification/-/issues/12#note_2594710326

The fix appears to be as simple as adding the -depth options to find, which forces it to process each directory's contents in depth-first order.

Maybe fixes https://gitlab.com/gitlab-com/ops-sub-department/zos-runner/phase-1-certification/-/issues/12

Edited by Axel von Bertoldi

Merge request reports

Loading