mirror of
https://hub.njuu.cf/TheAlgorithms/C-Plus-Plus.git
synced 2023-10-11 13:05:55 +08:00
add file-type to find
This commit is contained in:
parent
63f13ea50b
commit
18a74bb9a0
6
.github/workflows/clang-format.yml
vendored
6
.github/workflows/clang-format.yml
vendored
@ -24,14 +24,14 @@ jobs:
|
|||||||
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
|
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
|
||||||
- name: Filename Formatter
|
- name: Filename Formatter
|
||||||
run: |
|
run: |
|
||||||
for fname in $(find . -name '*.cpp' -o -name '*.h')
|
for fname in $(find . -type f -name '*.cpp' -o -name '*.h')
|
||||||
do
|
do
|
||||||
new_fname="$(echo -e "${fname}" | tr ' ' '_')"
|
new_fname="$(echo -e "${fname}" | tr ' ' '_')"
|
||||||
new_fname="$(echo -e "${new_fname}" | tr 'A-Z' 'a-z')"
|
new_fname="$(echo -e "${new_fname}" | tr 'A-Z' 'a-z')"
|
||||||
if [ $fname != $new_fname ]
|
if [ $fname != $new_fname ]
|
||||||
then
|
then
|
||||||
echo -e "'"$fname"' --> '"$new_fname"'"
|
echo -e "$(echo -e "$fname")" --> '"$new_fname"'"
|
||||||
git mv "$(echo -e "$fname")" $new_fname
|
git mv "$fname" $new_fname
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
git commit -am "formatting filenames $GITHUB_SHA" || true
|
git commit -am "formatting filenames $GITHUB_SHA" || true
|
||||||
|
Loading…
Reference in New Issue
Block a user