mirror of
https://github.com/gitattributes/gitattributes.git
synced 2025-01-22 08:18:50 -05:00
docs: posix compliant script
This commit is contained in:
parent
8075afad8d
commit
a9b4cc3d8b
10
README.md
10
README.md
@ -13,12 +13,12 @@ ## CI step
|
||||
To check if all files have a corresponding rule in .gitattributes, this script can be used:
|
||||
|
||||
```sh
|
||||
missing_attributes=$(git ls-files | git check-attr -a --stdin | grep "text: auto")
|
||||
if [[ "$missing_attributes" ]]; then
|
||||
echo ".gitattributes rule missing for the following files:";
|
||||
echo "$missing_attributes";
|
||||
missing_attributes=$(git ls-files | git check-attr -a --stdin | grep 'text: auto' || printf '\n')
|
||||
|
||||
if [ -n "$missing_attributes" ]; then
|
||||
printf '%s\n%s\n' '.gitattributes rule missing for the following files:' "$missing_attributes"
|
||||
else
|
||||
echo "All files have a corresponding rule in .gitattributes";
|
||||
printf '%s\n' 'All files have a corresponding rule in .gitattributes'
|
||||
fi
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user