Remove unnecessary uses of ls (#2311)

Other call sites need the call to readdir/getdents64.
This commit is contained in:
Andrew Gaul 2023-09-13 22:27:12 +09:00 committed by GitHub
parent e9814b4a4d
commit f493cb5846
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -393,7 +393,7 @@ function test_external_directory_creation {
echo "data" | aws_cli s3 cp - "s3://${TEST_BUCKET_1}/${OBJECT_NAME}"
# shellcheck disable=SC2010
ls | grep -q directory
ls directory >/dev/null 2>&1
stat directory >/dev/null 2>&1
get_permissions directory | grep -q 750$
ls directory
cmp <(echo "data") directory/"${TEST_TEXT_FILE}"
@ -2254,8 +2254,7 @@ function test_not_existed_dir_obj() {
fi
# Single nest directory
# shellcheck disable=SC2010
if ! ls -d not_existed_dir_single | grep -q '^not_existed_dir_single$'; then
if ! stat not_existed_dir_single; then
echo "Expect to find \"not_existed_dir_single\" directory, but it is not found"
return 1;
fi
@ -2271,8 +2270,7 @@ function test_not_existed_dir_obj() {
fi
# Double nest directory
# shellcheck disable=SC2010
if ! ls -d not_existed_dir_parent | grep -q '^not_existed_dir_parent'; then
if ! stat not_existed_dir_parent; then
echo "Expect to find \"not_existed_dir_parent\" directory, but it is not found"
return 1;
fi
@ -2281,8 +2279,7 @@ function test_not_existed_dir_obj() {
echo "Expect to find \"not_existed_dir_parent/not_existed_dir_child\" directory, but it is not found"
return 1;
fi
# shellcheck disable=SC2010
if ! ls -d not_existed_dir_parent/not_existed_dir_child | grep -q '^not_existed_dir_parent/not_existed_dir_child'; then
if ! stat not_existed_dir_parent/not_existed_dir_child; then
echo "Expect to find \"not_existed_dir_parent/not_existed_dir_child\" directory, but it is not found"
return 1;
fi