Skip to content

Commit

Permalink
find_modified_lock_files: allow having no modifications
Browse files Browse the repository at this point in the history
`tests/scripts/find_modified_lock_files` currently fails if we have no
modifications at all due to `grep` finding even no files allowed to be
modified

CMK-17193

Change-Id: Ie74f4afe5e15f938560b28d02188dbaf8770694a
  • Loading branch information
Frans Fürst committed Jan 1, 2025
1 parent ffd499d commit 9f48a7f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/scripts/find_modified_lock_files
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set -e
# TODO: enable this test also for package-lock.json (CMK-11132)
FILES_NOT_ALLOWED_TO_BE_MODIFIED="package.json\|Cargo.lock"

MODIFIED_FILES=$(git status -s | grep '^ M')
MODIFIED_FILES=$(git status -s | grep '^ M' || true)
NOT_ALLOWED_TO_BE_MODIFIED_FILES=$(echo "${MODIFIED_FILES}" | grep ${FILES_NOT_ALLOWED_TO_BE_MODIFIED} || true)
echo -e "The following files are modified: \n${MODIFIED_FILES}"

Expand Down

0 comments on commit 9f48a7f

Please sign in to comment.