Skip to content

Commit

Permalink
Remove an instance of ls|grep
Browse files Browse the repository at this point in the history
To remove 2 instances of this warning from the shellcheck run:

^-- SC2010 (warning): Don't use ls | grep. Use a glob or a for loop with a condition to allow non-alphanumeric filenames.
  • Loading branch information
pallavisontakke committed Nov 11, 2024
1 parent 342a58c commit 7e2da7c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
11 changes: 10 additions & 1 deletion scripts/release/create_minor_release_PR_commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,16 @@ rm CHANGELOG.md.tmp
echo "---- Deleting all unreleased pr_* , fix_* , ... style files, except template ones ----"

cd .unreleased
ls |grep -vi 'template' |grep -vi 'release_notes'|xargs git rm

for f in ./*
do
case $f in
*template.*) true;;
*RELEASE_NOTES*) true;;
*) git rm "$f";;
esac
done

cd ..

git diff HEAD --name-only
Expand Down
11 changes: 10 additions & 1 deletion scripts/release/create_release_PR_commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,16 @@ rm CHANGELOG.md.tmp
echo "---- Deleting all unreleased pr_* , fix_* , ... style files, except template ones ----"

cd .unreleased
ls |grep -vi 'template' |grep -vi 'release_notes'|xargs git rm

for f in ./*
do
case $f in
*template.*) true;;
*RELEASE_NOTES*) true;;
*) git rm "$f";;
esac
done

cd ..

git diff HEAD --name-only
Expand Down

0 comments on commit 7e2da7c

Please sign in to comment.