guard against two level subdir moves
this has never worked since the -wholename check only works for one level deep
This commit is contained in:
@@ -27,7 +27,7 @@ if [[ "${BOX_ENV}" == "test" ]]; then
|
||||
fi
|
||||
|
||||
# copy and remove - this way if the copy fails, the original is intact
|
||||
# the find logic is so that move to a subdir works (and we also move hidden files)
|
||||
# the find logic is so that move to a one level subdir works (and we also move hidden files)
|
||||
find "${source_dir}" -maxdepth 1 -mindepth 1 -not -wholename "${target_dir}" -exec cp -ar '{}' "${target_dir}" \;
|
||||
find "${source_dir}" -maxdepth 1 -mindepth 1 -not -wholename "${target_dir}" -exec rm -rf '{}' \;
|
||||
# this will fail if target is a subdir or if source is a mountpoint
|
||||
|
||||
Reference in New Issue
Block a user