add /target/ to .gitignore files for all crates (#4217)

* add /target/ to .gitignore files for all crates

* shellcheck
This commit is contained in:
Rob Walker
2019-05-08 12:15:05 -07:00
committed by GitHub
parent 5719b8f251
commit a80176496d
40 changed files with 52 additions and 4 deletions

View File

@ -38,3 +38,17 @@ if _ git grep 'Default::default()' -- '*.rs'; then
exit 1
fi
# Let's keep a .gitignore for every crate, ensure it's got
# /target/ in it
declare gitignores_ok=true
for i in $(git ls-files \*/Cargo.toml ); do
dir=$(dirname "$i")
if [[ ! -f $dir/.gitignore ]]; then
echo 'error: nits.sh .gitnore missing for crate '"$dir" >&2
gitignores_ok=false
elif ! grep -q -e '^/target/$' "$dir"/.gitignore; then
echo 'error: nits.sh "/target/" apparently missing from '"$dir"'/.gitignore' >&2
gitignores_ok=false
fi
done
"$gitignores_ok"